我怎样才能看到我即将推出的git? [英] How can I see what I am about to push with git?

查看:112
本文介绍了我怎样才能看到我即将推出的git?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法看到如果我做了一个 git push 命令会推动什么?



我想像的就像Github的pull request功能的Files Changed选项卡。当我发出拉请求时,如果他们接受我的拉请求,我可以看看会看到什么:

命令行可以,但我更喜欢某种图形用户界面(如上面的屏幕截图)。


<对于要推送的文件列表,请运行:

  git diff --stat --cached [remote / branch] 

  git diff --stat --cached origin / master 
code>

对于要推送的文件的代码diff,运行:

  git diff [remote repo / branch] 

要查看将更改的文件的完整文件路径,请运行: diff --numstat [remote repo / branch]

如果你想在GUI中看到这些差异, ÿ ou需要为此配置git。请参阅如何查看'git diff'输出与视觉差异程序?


Is there a way to see what would be pushed if I did a git push command?

What I'm picturing is something like the "Files Changed" tab of Github's "pull request" feature. When I issue a pull request, I can look and see what will be pulled in if they accept my pull request:

Command line is OK, but I'd prefer some sort of GUI (like the screenshot above).

解决方案

For a list of files to be pushed, run:

git diff --stat --cached [remote/branch]

example:

git diff --stat --cached origin/master

For the code diff of the files to be pushed, run:

git diff [remote repo/branch]

To see full file paths of the files that will change, run:

git diff --numstat [remote repo/branch]

If you want to see these diffs in a GUI, you will need to configure git for that. See How do I view 'git diff' output with a visual diff program?.

这篇关于我怎样才能看到我即将推出的git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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