Skip to content

Instantly share code, notes, and snippets.

@ishan-marikar
Forked from tecoholic/gitpatch.sh
Created January 22, 2018 07:54
Show Gist options
  • Save ishan-marikar/f706dbe777bd23340243d707e103c0d6 to your computer and use it in GitHub Desktop.
Save ishan-marikar/f706dbe777bd23340243d707e103c0d6 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