Create a github branch and merge using command line
1. change into the working directory
$cd DIRNAME
2. check what branch you are on
$git branch
>> *master work1
Note that the star signifies the current branch
3. switch to master branch (if necessary) and make sure you are update on the master branch
$git checkout master
if you are not on master branch, this switches you to the master branch
$git pull
this updates the master branch
4.create a new branch
$ git checkout -b newBranch
this creates a new branch named “newBranch”, and switches to it
5. push the git push
git push origin newBranch
6. set upstream of the branch
git branch --set-upstream-to=origin/branch name
7. work on that branch for a while
8. add the work
$git add .
It adds all work
7.commit the work
$git commit -m “the commit message”
It commits the work, and creates a commit message
8.check the git status
$git status
check to make sure the branch is clean
9. switch to master branch again and make sure it’s updated
$git checkout master
$git pull
10. switch to newBranch and merge master
$git checkout newBranch
$git merge master
11. push it to github
$ git push
12. go to github website and make a pull request
13. on the github website compare and review
14. on the github website create a pull request
15.on the github website send the pull request to your team mate for them to review
16. If anything goes well, your team mate will click on the confirm merge
17. Then s/he will delete the branch on the github website
18. Now delete the branch on your local computer
$git branch -d newBrach















