How to Recover a Mistakenly Deleted Branch
Workflow git checkout -b _new_branch_name # do some work and commit changed git checkout master git branch -d _new_branch_name # doh... i meant to merge first Fortunately, you can easily recover from this mistake. git reflog 395b1ea HEAD@{0}: checkout...
Written by Sean Behan on 06/17/2012
Git Feature Branch Naming Strategy
There are only two hard things in Computer Science: cache invalidation and naming things. -- Phil Karlton Typically, we have three main branches at any given time in a project lifecycle. master, development and staging. Master is production ready code, d...
Written by Sean Behan on 06/17/2012
Git: How to Delete a Branch with an Invalid Name
If you've named a branch beginning with two dashes "--", you're sort of in trouble because git interprets your branch name as a switch/flag. You can skip switches all together by supplying two dashes before your branch name git branch -d -- --index_for_...
Written by Sean Behan on 06/17/2012
Very Basic Git Workflow
Very, very basic git workflow git pull git branch dev_branch git checkout dev_branch #make some changes git checkout master git merge dev_branch git branch -d branch_to_delete git push
Written by Sean Behan on 06/17/2012
Working with Branches in Git
Show all the branches git branch Create a new branch git branch my_experimental_feature Use that branch git checkout my_experimental_feature Pushing the new branch to a remote server git push origin my_experimental_feature Pulling that branch down...
Written by Sean Behan on 06/17/2012