The process consists of 6 main steps:
- Forking: Making a copy of the project on your github.
- Cloning: Making a local copy of the project.
- Branching: Creating another version to work in before using master.
- Rebasing: Making sure your branch is up to date with the main project.
- Push: Adding your changes to your github
- Pull: Requesting for your changes to be added to main project.
-
Go to the main page for the repository: https://github.com/FreeCodeCampLondon/git-practice
-
Click on the 'Fork' button in the upper right hand corner. Detailed instructions here.
-
Once this is done you will be taken to your copy of the repository at
yourUserName/git-practice -
Clone your fork locally and
cdinto the new directory:git clone https://github.com/yourUserName/git-practice.gitcd git-practice -
Add the main repository as a remote branch so that you can rebase later
git remote add upstream https://github.com/FreeCodeCampLondon/git-practice.git
-
Create new branch to make changes on and move to that branch
git checkout -b update/your-name
-
Open text document campers.txt and add your name to the list and save the document.
-
Commit your change to your local branch:
git add campers.txtgit commit -m 'add Your Name'
Before making your Pull Request you need to make sure that you are up to date with the main repository.
-
Switch to the
masterbranchgit checkout master -
Update
masterto be inline with the main repositorygit pull --rebase upstream master -
(Optional) Push
masterto your fork for good measure.git push origin master --force -
Switch back to your branch (change
type/branch-nameto your branch name)git checkout update/your-name -
Rebase your branch from master
git rebase master -
Push your branch to your fork
git push origin update/your-name -
You are now ready to submit a Pull Request
- Once you have pushed all your changes to your fork navigate to the GitHub page for your fork.
- In the Branch menu, choose the branch that you were working on.
- On the right of the page click on New Pull Request
- Change the title to your name
- Click on Create pull request
- Your Pull Request will be reviewed by the core team before being merged into the main repository.