jcadima
5/22/2017 - 1:48 PM

Git create new branch, make changes, push to remote master

Git create new branch, make changes, push to remote master

https://www.youtube.com/watch?v=uR-9NGrpU-c

1) create new branch
$ git branch ces

2) change to this branch 
$ git checkout ces

3) make some changes to the master files
$ git add --all
$ git commit -m "ces additions" 
this creates a new version so you can switch between master and this branch

4) git checkout master
you wont see the changes made in ces

5) change back to ces branch
$ git checkout ces

6) push this branch to remote , so that its seen in github
$ git push origin ces
you should now see the remote with 2 branches


7) merge with master
$ git checkout master // first change to master branch
$ git merge ces  // merge with our branch
this merges the file changes/insertions into master (local)


8) push to master
$ git push origin master
this pushes the changes to the master and all changes are visible (remote repo)