git create fork code example

Example 1: git how to work with remote branch and fork

Step 1) Checkout new branch `git checkout -b new-branch`
Step 2) Make changes
Step 3) Add to git `git add .`
Step 4) Commit `git commit -m "Made changes!"` or `git commit -a`
Step 5) Push to your repo `git push origin new-branch`
Step 6) Make PR from pushed branch
Step 7) Merge into dev after it passes tests
* http://jenkins.corp-domain.local/job/AwesomeProject0/
* Click "Scan Repository Now"
Step 8) Make PR from dev into master
Step 9) Merge dev into master once tests pass
Step 10) Update local copy and remote fork
* git checkout master -> git pull upstream master -> git push origin master
* git checkout dev -> git pull upstream dev -> git push origin dev

-------------
Rebase/Upstream

1. `git remote add upstream https://github.corp-domain.com/DataScienceSourceCode/AwesomeProject0.git`
2. `git remote -v`
3. `git fetch upstream`
4. Check out your fork’s local master branch by issuing `git checkout master`
5. Merge the changes from upstream/master into your local master branch by issuing `git merge upstream/master`
6. `git push`  

-------------

`git fetch upstream`
`git checkout master`
`git merge upstream/master`
`git push`

Example 2: github fork

GitHub fork
Featured snippet from the web
A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project. Most commonly, forks are used to either propose changes to someone else's project or to use someone else's project as a starting point for your own idea.

Example 3: fork on github code

$ git clone https://hostname/YOUR-USERNAME/Spoon-Knife