Skip to content

Instantly share code, notes, and snippets.

@rubygeek
Last active August 27, 2017 23:11
Show Gist options
  • Save rubygeek/85664d2c884b0c3e91a547963e351080 to your computer and use it in GitHub Desktop.
Save rubygeek/85664d2c884b0c3e91a547963e351080 to your computer and use it in GitHub Desktop.

Working on project

Always make a branch to work on, you can always throw it away if it doesn't work.

Go into your folder of projects:

> git checkout -b myawesomebranch

This creates a branch and checkes it out, you are now inside of this branch.

do your work

when ready to save it

> git add .
> git commit -m "i just did awesome stuff on this branch" 
> git push origin myawesomebranch

You can show your instructor or mentor the branch

If you decide to keep it and merge back to master

> git checkout master 
> git merge myawesomebranch

If you want to delete a branch on github you can go to the web interface and delete it. That is the most straight forward way :)

To delete a branch on your computer

> git branch -d myawesomebranch

Note: you can't delete a branch you are on :) doh :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment