Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
727 views
in Technique[技术] by (71.8m points)

git equivalent of svn status -u

What's the git equivalent of svn status -u or more verbose svn status --show-updates. The svn status --show-updates command shows the updates that the svn update command will bring from the server.

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I can't think of a way to do it without actually fetching the updates (maybe someone else will). Assuming you are on the default branch "master" and the upstream from which these hypothetical updates will come is the default remote "origin", try....

git fetch
git log --name-only ..origin/master

Note the double dots .. not a single dot or an elipsis1.

This will give you a list of log entries for changes that are only upstream, with the filenames affected, you can alter the parameters to git log to get more or less information.

NB in git "fetching" these updates isn't the same as applying them to your local branch. You no doubt already know how to do that with git pull.


1 As for where do the double dots come from, name1..name2 indicates a range. If name1 is omitted, HEAD is used in its place. This syntax refers to all commits reachable from name2 back to, but not including, HEAD. ["Git from the bottom up"]


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...