progit2 icon indicating copy to clipboard operation
progit2 copied to clipboard

Given `diff-tree` example in Git Subtree Merging article does not seem to work.

Open tswast opened this issue 8 years ago • 4 comments

This issue if for the subtree-merges.asc file published here.

I tried the command

git diff-tree -p rack_branch

and

git diff-tree -p rack_remote/master

but every time I ran them, I got no output after making changes. I got no output whether my change was a working copy, staged, or committed.

What did work for me was:

git diff-tree -p HEAD:rack/ rack_remote/master

or to diff against your local branch:

git diff-tree -p HEAD:rack/ rack_branch

I considered sending a PR to fix this, but maybe I missed something?

tswast avatar Mar 18 '16 16:03 tswast

There's some discussion here about this page, as well: http://answers.candoerz.com/question/42994/git-diff-tree-showing-changedset-already-merged.aspx

tswast avatar Mar 18 '16 16:03 tswast

The published link you provided is Pro Git v1. Here is Pro Git v2 - 7.8 Advanced Merging .

YueLinHo avatar Mar 18 '16 23:03 YueLinHo

@tswast the discussion link is broken. Perhaps this is the original discussion: https://stackoverflow.com/questions/29901431/git-diff-tree-showing-changedset-already-merged

@YueLinHo v2 shows the same diff-tree notation. From what I can tell, the tree-ish id of the mapped subdirectory must also be specified as @tswast indicated.

ghost avatar Oct 19 '17 02:10 ghost

@tswast I think an important note here is that, the changes must be committed to be seen in diff-tree output of the workable versions of commands you provided above. Am I correct?

Is there any way to compare working copy before committing them?

athrunsun avatar Dec 06 '17 03:12 athrunsun