I didn't want to lose some information after a git pull
, so I did a git fetch
before. Where can I read the new modifications after a git fetch
? I went to the FETCH_HEAD
file, but there was nothing more than a big number.
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
git fetch origin
by default fetches everything from the remote named "origin" and updates (or creates) the so-called "remote-tracking branches" for that remote. Say, for the remote named "origin" which contain branches named "master" and "feature", runninggit fetch remote
will result in the remote-tracking branches named "origin/master" and "origin/feature" being updated (or created, if they're not exist). You could see them in the output ofgit branch -a
(notice "-a").Now, the usual Git setup is that (some of) your local branches follow certain remote branches (usually same-named). That is, your local "master" branch follows "origin/master" etc.
So, after you fetched, to see what remote "master" has compared to your local "master", you ask Git to show you exactly this:
which means «all commits reachable from "origin/master" which do not include commits reachable from "master"» or, alternatively
which has the same meaning. See the "gitrevisions" manual page for more info, especially the "Specifying ranges" part. Also see the examples in the git-log manual page
You're free to customize the output of
git log
as you see fit as it supports a whole lot of options affecting it.Note that your local branch might also have commits which the matching remote branch does not contain (yet). To get an overview of them you have to reverse the revisions passed to
git log
for (hopefully) obvious reasons.As usual, it's essential to educate yourself to understand the underlying concepts before starting to use a tool. Please do.
Try
This will give you the change log from the
master
head of theorigin
remote (you can substitute any other remote branch as needed). You'll get an output somewhat like this:The commit marked
(master)
is the head of your localmaster
branch. The commit marked(origin/master)
is the head of the remote'smaster
branch.If you just want to see what files will be modified if you do a GIT PULL, do this:
If you want to see ALL differences between your current version and the incoming version, including uncommited local modifications, type this: