git:如何查看下次推送将发送的更改 [英] git: how to see changes the next push will send
问题描述
我想查看下一个 push
会做的所有更改的列表。 git status
似乎知道我已经进行了本地提交...我如何知道这些是什么?我一直在做的是这样的:
%git status
#分支主
#你的分支在7次提交之前超过'origin / master'。
...
好的,它表示 7 提交。所以我做了
pre $ g $ diff $名称状态HEAD〜7
M bin / bench
M scala / 001 / 02.scala
M scala / 007 / 01.scala
一个scala / 010 / 01.scala
一个scala / 016 / 01.scala
A scala / 020 / 01.scala
是否有更简洁的方法来执行此操作?我习惯了svnsvn diff基本上会这样做,因为没有staged / unstaged的概念。
git diff --name-status origin / master
请注意,你也可以在你的git配置文件中定义一个别名,比如newmaster:
git config alias.newmaster diff --name-status origin / master
完成此操作后,您可以使用
git newmaster
<得到你想要的东西。
I want to see a list of all changes the next push
would do. git status
seems to know that I've made local commits... how do I have it show me what those are? What I've been doing is something like this:
% git status
# On branch master
# Your branch is ahead of 'origin/master' by 7 commits.
...
Okay, it said 7 commits. So then I do
% git diff --name-status HEAD~7
M bin/bench
M scala/001/02.scala
M scala/007/01.scala
A scala/010/01.scala
A scala/016/01.scala
A scala/020/01.scala
Is there a more concise way to do this? I'm used to svn where "svn diff" would essentially do this, because there's no notion of staged/unstaged.
git diff --name-status origin/master
Note that you can also define an alias in your git configuration file, such as the "newmaster" one:
git config alias.newmaster "diff --name-status origin/master"
Once this is done, you can use
git newmaster
to get what you want.
这篇关于git:如何查看下次推送将发送的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!