gedankensplitter/git_usage.md

29 lines
809 B
Markdown
Raw Normal View History

2023-01-14 15:54:44 +00:00
## git
### git file permission ignore
2023-03-11 13:17:21 +00:00
`git config core.fileMode false`
### cheat sheet
find and clean up repositories recursvely
2023-07-04 07:19:52 +00:00
`find . -type d -name '.git' -prune -execdir bash -c "pwd; git reflog expire --all --expire=now; git gc --aggressive --prune=now" \;`
### gnome key store
to change/activate git credential storing within the gnome key store:
2023-08-10 15:52:26 +00:00
`git config --global credential.helper libsecret`
### merge editor
2023-11-16 08:30:08 +00:00
`git config --global core.editor "vim"`
### get repo and all branches
```
```bash
git branch -r | grep -v '\->' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
2023-12-28 08:54:49 +00:00
```
### show diff against stack
2024-02-26 14:12:17 +00:00
`git stash show -p`
### force submodule update
`git submodule update --init --force --remote`