Skip to content

Instantly share code, notes, and snippets.

@joselo
Created January 14, 2014 16:53
Show Gist options
  • Save joselo/8421582 to your computer and use it in GitHub Desktop.
Save joselo/8421582 to your computer and use it in GitHub Desktop.
Get started with Git and Github very basic tutorial
Github Notes
Site: http://github.com
Repository: https://github.com/joselo/arupo
Working with Git Branches on Github
1) Create a change to new branch
$ git checkout -b cipre
2) Make changes etc.
$ git commit -a -m "some comment"
3) Push the changes and create new branch in GitHub
$ git push origin cipre
4) Track the branch in GitHub
$ git checkout master
$ git branch -D cipre
5) Checkout to the remote branch Important!!
$ git checkout --track -b cipre origin/cipre
$ git pull
6) Make changes normality and pull them
$ git commit -a -m "changes"
$ git push origin cipre
Merge to master Branch
1) Change to the master branch
$ git branch
master
* cipre
$ git checkout master
Switched to branch 'master'
$ git branch
* master
cipre
2) Merge the branch (cipre) to the master branch
$ git merge cipre -m "merge cipre into master"
3) Push the changes to the master branch
$ git push origin master
4) Optional: Come back to the previews branch and continue working :)
$ git checkout cipre
Switched to branch 'cipre'
$ git branch
master
* cipre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment