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.
In Git, we can use git show commit_id --name-only to list all the committed files that are going to push to the remote repository.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With