Git Snippets
While on master branch, make a new branch to make new changes:
> git branch --list
* master
> git branch feature1
> git checkout feature1
Switched to branch 'feature1'
> git branch --list
* feature1
master
Make changes in feature1 branch, and commit it and create patch:
> git format-patch master --stdout > feature1.patch
Now checkout master branch and apply patch:
> git checkout master
Switched to branch 'master'
> git apply --stat feature1.patch
> git apply --check feature1.patch
> git am --signoff < feature1.patch
git checkout -- < file >
git reset HEAD < file >