-
-
Save taichiman/7747280 to your computer and use it in GitHub Desktop.
Commit: | |
git diff --check (убирает whitespace) | |
== | |
git update-index --assume-unchanged <file> | |
git update-index --no-assume-unchanged <file> | |
== | |
git log one-branch..another-branch shows everything that one-branch needs to have everything another-branch has. | |
You may also be interested in git show-branch as a way to see what's where. | |
== | |
Aliases:
Adding to the existing answers (esp. Jan's), an alias could be created to show the diff and/or log prior to a merge. For completeness, the other answers omit the fetch to be done first before "previewing" the merge; an alias can combine these two steps into one.
So, building on "git log ..otherbranch", you can add the following to ~/.gitconfig (emulating something similar to hg incoming/outgoing):
...
[alias]
# fetch and show what would be merged (use option "-p" to see patch)
incoming = "!git remote update -p; git log ..@{u}"
For symmetry, the following alias can be used to show what is committed and would be pushed, prior to pushing:
# what would be pushed (currently committed); see also alias difr
outgoing = log @{u}..
And then you can run "git incoming" to show a lot of changes, or "git incoming -p" to show the patch (i.e., the "diff"), "git incoming --pretty=oneline", for a terse summary, etc. You can then (optionally) run "git pull" to actually merge. (Though, since you've already fetched, the merge could be done directly.)
Likewise, "git outgoing" shows what would be pushed if you were to run "git push".
посмотреть как менялся файл
git log --graph --decorate --oneline Gemfile
Посмотреть что изменилось в репе перед мерджем.
Сначала fetch.
можно посмотреть какие файлы поменялись
git diff --name-status origin/master
посмотреть какие комиты добавились
git log --oneline master..origin/master
git log ...@{u}
посмотреть: что добавилось в коммитах
git log -p --reverse ...origin/master
или
git show ..otherbranch
или
git log ..otherbranch
list of changes that will be merged into current branch.
git diff ...otherbranch
diff from common ancestor (merge base) to the head of what will be merged. Note the three dots.
gitk ...otherbranch
graphical representation of the branches since they were merged last time.
two dots (a..b) is simple difference from a to b and three dots (a...b) mean difference between common ancestor and b (git diff $(git merge-base a b)..b)