ItGo.me Focus on IT Recommend

Home > Git diff/copy of stashed branch against/to current branch

Git diff/copy of stashed branch against/to current branch

2020腾讯云双十一活动,全年最低!!!(领取3500元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1073

2020阿里云最低价产品入口,含代金券(新老用户有优惠),
入口地址https://www.aliyun.com/minisite/goods

I am working on branch XYZ. I want to know how foo.c in this branch compares with stash{0} on master. Something like

git diff master@stash@{0} foo.c

which does not work. Now I want that stashes foo.c to replace my local file. Something like

git checkout master@stash@{0} foo.c

Edit: I did not realize that stashes aren't owned by a branch, but the stash itself identifies which branch it is a stash of. Problem solved.

Recommend:Make the current git branch a master branch

r and to the branch. Then, tens of commits later, I realized the branch is in much better state than the master, so I want the branch to "become" the master and disregard the changes on master. I cannot merge it, because I don't want to kee

git diff
edited Feb 12 '13 at 22:09 asked Feb 12 '13 at 20:39 user1088084 109 1 8 1   possible duplicate of Git diff against a stash –  R0MANARMY Feb 12 '13 at 21:14 1   another possible duplicate Git: how to diff the same file between two different commits on the same branch?, although that talks about diffing on the same branch, it'll work across branches. –  R0MANARMY Feb 12 '13 at 21:15      This is how you check out file from another commit (in your case stash): How do I revert one file to the last commit in git? –  R0MANARMY Feb 12 '13 at 21:17      @ROM those two duplicates you mention are diffing within the same branch right? I want to diff between branches, and actually the stash of one branch. Isn't that different? –  user1088084 Feb 12 '13 at 21:49 1   @ROM ahhhh now I see why you say that. I just installed gitg which made it obvious to me that stashes are not subobjects of a branch but rather have an attribute indicating the branch they were stashed from! –  user1088084 Feb 12 '13 at 22:07  |  show more comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Recommend:phabricator - Can you arc diff against a particular git branch

ricator Differential instance using Arcanist) against a git branch that I'm currently checked-out/working in (and I have one local un-pushed commit) rather than the master. To me the arc docs are unclear on this. Is it possible How It wou

------splitte line----------------------------