gists/git.md

26 lines
818 B
Markdown
Raw Normal View History

2021-11-30 14:49:01 +00:00
# Git
### What commit added a certain file?
2021-11-30 14:52:50 +00:00
```git log --diff-filter=A -- path/file```
2021-11-30 14:49:01 +00:00
### Edits of a certain file
2021-11-30 14:52:50 +00:00
```git diff <branch> -- path/file```
2021-11-30 14:50:45 +00:00
### Git pull
```
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:
hint: git config pull.rebase false # merge (the default strategy)
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
```