git everything -p
By everything I mean:
git checkout -p
git reset -p
git stash -p
git add -p
and possibly more...
What do these do? well if you know git add -p
then you can easily guess. However they can be used in many different combinations.
One use for git checkout -p
is to revert a 'hunk' which is commited into HEAD. e.g. git checkout -p -- filename.ext
. You can also do this for any ref! such as git checkout HEAD~10 -p -- filename.ext
or git checkout branch-name -p -- filename.ext
Written by Kristian Lewis Jones
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#