Skip to content

Instantly share code, notes, and snippets.

@tecoholic
Created June 7, 2011 05:43
Show Gist options
  • Save tecoholic/1011749 to your computer and use it in GitHub Desktop.
Save tecoholic/1011749 to your computer and use it in GitHub Desktop.
Creating Patches in GIT
#To visualize branches:
git branch
#To create a new branch:
git branch testbranch
#To change to created branch:
git checkout testbranch
#Track new files:
git add .
#or
git add *
#To make a commit:
git commit -am 'commit message'
#To delete a branch (you need be in other branch to do that):
git branch -D testbranch
#To remove the last commit:
git reset --hard HEAD
#Create patches between two branches:
git format-patch master..testbranch
#Create Patch without branching
git format-patch HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment