|
| 1 | +# Private Repository |
| 2 | + |
| 3 | +## How to create your private repository in RS School? |
| 4 | + |
| 5 | +At the beginning of the course, you need to: |
| 6 | + |
| 7 | +- open `Dashboard` in [RS App](https://app.rs.school) |
| 8 | +- click "Create repository" (or "Fix repository" if repository settings need to be reset to initial state) |
| 9 | +- GitHub automatically sends you an invite to access the repository. The invite comes to the email you specified when registering on GitHub (not the email you specified in RS App) |
| 10 | + |
| 11 | +## How to work with a private repository? |
| 12 | + |
| 13 | +- Clone it to your computer: |
| 14 | + `git clone https://github.com/rolling-scopes-school/<your-school-repository>.git` |
| 15 | +- Go to the cloned repository folder: |
| 16 | + `cd <your-school-repository>` |
| 17 | +- Set your data in the config (enter the email linked [to your GitHub account](https://github.com/settings/emails)): |
| 18 | + `git config user.name "Name Surname"` |
| 19 | + `git config user.email "your@email"` |
| 20 | +- Create a branch from `main` with the assignment name: |
| 21 | + `git checkout -b <task-name>` |
| 22 | +- Create a folder with the assignment name: |
| 23 | + `mkdir <task-name>` |
| 24 | + All files related to the assignment should be in it. |
| 25 | +- Complete the assignment, committing solutions in the process (see [commit requirements](https://docs.rs.school/#/git-convention)). |
| 26 | +- Push the branch to the remote branch on GitHub: |
| 27 | + `git push origin <task-name>` |
| 28 | +- Create a Pull Request from branch `<task-name>` to branch `main`. You don't need to merge the Pull Request. |
| 29 | + |
| 30 | +## How to deploy an assignment from the school's private repository? |
| 31 | + |
| 32 | +1. In the `gh-pages` branch, you need to place a folder with the assignment name, and the project files in it. The `index.html` file should be at the top level. This can be done in two ways: |
| 33 | + - for projects that don't use `webpack`, it's enough to make a Pull Request from the development branch to the `gh-pages` branch and merge it. |
| 34 | + - for projects that use `webpack`, you need to create a project build by running the `npm run build` command, create a folder with the assignment name in the `gh-pages` branch, and place the built project files in the created folder. Note that the `.gitignore` file lists the names of folders created during application build. Therefore, in the `gh-pages` branch, the `.gitignore` file can be deleted. |
| 35 | +2. The link to the deployed application version looks like: `https://rolling-scopes-school.github.io/repository-name/folder-name`, where |
| 36 | + - `repository-name` - your repository name in rs school |
| 37 | + - `folder-name` - the folder name with project files |
| 38 | +3. All other projects are deployed this way, a separate folder is created for each of them |
| 39 | + - this is how the `gh-pages` branch [looks](https://docs.rs.school/images/deploy-to-gh-pages.png) with project folders |
| 40 | + - example link: `https://rolling-scopes-school.github.io/irinainina-JS2020Q3/repair-design-project/` |
| 41 | + |
| 42 | +#### Video [Deploy to GitHub Pages](https://www.youtube.com/watch?v=0lvKcqP3aP0) |
| 43 | + |
| 44 | +## FAQ |
| 45 | + |
| 46 | +### I deleted the gh-pages branch, what should I do? |
| 47 | + |
| 48 | +1. Create the `gh-pages` branch from `main` again and push it to your school private repository |
| 49 | +2. In `Dashboard` RS App, click the `Fix repository` button |
| 50 | +3. Make any commit to the `gh-pages` branch and push the changes. (Each push to `gh-pages` triggers the deployment mechanism for this branch) |
| 51 | +4. Wait 5 minutes |
| 52 | + |
| 53 | +### I can't open/merge a Pull Request from the development branch to the gh-pages branch, what should I do? |
| 54 | + |
| 55 | +1. Delete the `gh-pages` branch on GitHub |
| 56 | +2. In `Dashboard` RS App, click the `Fix repository` button |
| 57 | +3. Merge the Pull Request into the `gh-pages` branch |
| 58 | + |
| 59 | +### My site is not deploying and the Deployments section is not appearing, what should I do? |
| 60 | + |
| 61 | +- Go to the settings of the private repository and check/set the required branch for deployment: `gh-pages/root` |
| 62 | +- If there's no settings section, in `Dashboard` RS App, click the `Fix repository` button, settings should appear. |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +## Adding a list of completed assignments and contacts to the private repository |
| 67 | + |
| 68 | +The created private repository already has a `readme.md` file with the repository name. |
| 69 | +You can add your contacts (or a link to CV with contacts) to this file and maintain a list of completed assignments in it. This will help reviewers find your work in case of an error during submission. |
| 70 | + |
| 71 | +After creating the `gh-pages` branch from `main`, this file will be copied there and will be available at |
| 72 | +`https://rolling-scopes-school.github.io/<repository-name>/` |
| 73 | + |
0 commit comments