来自远程Git仓库的拉取命令的详细模式

3
有没有一种方法可以在使用git pull origin master命令时显示所有提交,就像“verbose”或“debug”函数一样?
我只想看到提交了哪些更改。
7个回答

5

我经常使用git log命令。

你可以试试这个:

git log --graph --all --decorate

提供了很好的概述。

如果你使用的是Windows或MacOSX,我建议你尝试一下Sourcetree。这是我迄今为止尝试过的最好的GUI。 - gagge
1
我个人很喜欢使用 git log --graph --oneline --decorate --branches=* 命令,因为它可以生成易读却丰富的图示。 - srt32
@srt32 在 --branches=* 中,我需要添加引号,即:--branches='*' - CPHPython

1
我经常使用以下命令:git log --pretty=oneline 同时,我在我的.gitconfig文件中使用了以下别名:
[color]
    ui = true

[alias]

##### Log aliases
# Show HEAD commit
head = log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative -n1
# Short one line logs with ref-names
l  = log --oneline --decorate=short
# Shows the last git logentry (hash, author, date commitmessage)
llm = log -1
# Short one line logs with ref-names and statistics
gl = log --oneline --decorate --stat --graph
# Short one line logs with ref-names (yellow, date (green) and author (blue)
glog = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
# Show last commit
lc = log ORIG_HEAD.. --stat --no-merges
# Graph log with full commit message
glaaa = log --graph --abbrev-commit --date=relative

1
git pull --rebase -v  

"

-v 代表详细模式

"

1

我认为你想要执行 git fetch origin master 然后再执行 log


1
我认为你想使用git log -p命令。这里有更详细的说明Git查看提交历史。 如果你使用的是Max OS X操作系统,我建议使用GitX工具。

1
在同一分支上。
git checkout master
git status
# Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.
git diff origin/master 

你应该看到差异。

1
我不知道有什么方法可以在git pull操作中显示每个提交,但是原始的HEAD被git pull存储为ORIG_HEAD。因此,您可以在git pull之后执行以下操作来查看新内容:
git log --all --not ORIG_HEAD

alias.*部分,git-config有一个类似的别名,但使用gitk代替:

gitk --all --not ORIG_HEAD

您可以像这样创建一个别名new
git config --global alias.new 'log --all --not ORIG_HEAD'

或者使用gitk

git config --global alias.new '!gitk --all --not ORIG_HEAD'

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接