git 相当于 svn status -u [英] git equivalent of svn status -u

查看:22
本文介绍了git 相当于 svn status -u的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

svn status -u 或更详细的 svn status --show-updates 的 git 等价物是什么?svn status --show-updates 命令显示 svn update 命令将从服务器带来的更新.

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.

谢谢!

推荐答案

我想不出不实际获取更新的方法(也许其他人会这样做).假设您在默认分支master"上并且这些假设更新将来自的上游是默认远程origin",请尝试....

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

注意双点......不是单点或省略号1.

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

这将为您提供仅上游更改的日志条目列表,文件名受到影响,您可以将参数更改为 git log 以获取更多或更少的信息.

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.

注意 git 获取"这些更新与将它们应用到本地分支不同.毫无疑问,您已经知道如何使用 git pull 做到这一点.

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 至于双点是从哪里来的,name1..name2表示一个范围.如果省略 name1,则使用 HEAD 代替.此语法指的是从 name2 返回到但不包括 HEAD 的所有可到达的提交.["Git 自下而上"]

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"]

这篇关于git 相当于 svn status -u的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆