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

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

问题描述

什么是 svn status -u 或更详细的 svn status --show-updates 的git相当于什么。
svn status --show-updates 命令显示 svn update 命令将带来的更新服务器。



谢谢!

解决方案

的一种方式来做到这一点,而没有实际获取更新(也许别人会)。假设你在默认的分支master上,并且这些假想的更新将来自哪个上游是默认的远程origin,请尝试....

  git fetch 
git log - 仅限名称..origin / master

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

这会给你一个日志条目列表对于只在上游进行的更改,受影响的文件名,您可以将参数更改为git log以获取更多或更少的信息。



在git中获取这些更新与将它们应用到您当地的分支不同。你无疑已经知道如何用git pull做到这一点。






1 至于where做双点来自 name1..name2 表示一个范围。如果省略 name1 ,则使用 HEAD 代替它。此语法引用从 name2 返回到但不包括 HEAD 的所有提交。 [Git from bottom up ]


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!

解决方案

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

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

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