Github Commands
Create a new branch for (features, bugs)
Before create a branch, check if someone already created it, if there is, fetch the branch
1
| git fetch origin feature_FeatureName:feature_FeatureName
|
If there isn’t, create a new branch for it and define the upstream
1 2
| git checkout -b feature_FeatureName git push -u origin feature_FeatureName
|
Everyday BEFORE start working
Make sure you are on the correct branch and pull
1 2
| git checkout feature_FeatureName git pull
|
Everyday AFTER working
Make sure you are on the correct branch and push
1 2
| git checkout feature_FeatureName git push
|
The feature is done, then
1 2 3 4
| git checkout master git pull git checkout feature_FeatureName git rebase master
|
If the branch will never be used again
1
| git branch -d feature_FeatureName
|