git
Links
- <http://justinhileman.info/article/git-pretty/>
- <https://git.wiki.kernel.org/index.php/GitTips>
- [SO YOU THINK YOU KNOW GIT - FOSDEM 2024](https://fosdem.org/2024/schedule/event/fosdem-2024-3611-so-you-think-you-know-git/)
-
Gitconfig
-
Datei ist unter
~/.gitconfig
[core] editor = vim [user] name = yourname email = youremail@yourhost [merge] tool = vimdiff [color] ui = true [push] default = matching
-
-
Merge
- Interaktiver Merge:
git difftool branch file
- Interaktiver Merge:
-
Gitignore
-
# text files *~ *.swp # Latex: *.log *.fls _out_/*.pdf *.d *.aux *.bak *.make *.temp *.acn *.glo *.ist *.glg *.gls *.glsdefs *.lof *.lol *.lot *.toc *.acr *.alg *-blx.bib *.bbl *.bcf *.blg *.xml *.fdb_latexmk
-
-
Datei aus der History loeschen
-
git filter-branch --force --index-filter \ 'git rm --cached --ignore-unmatch pfad/dateiname' \ --prune-empty --tag-name-filter cat -- --all
Dann pushe es zu einer remote:
-
git push origin master --force
-
-
Teile einer Datei Commiten
- https://stackoverflow.com/questions/1085162/commit-only-part-of-a-file-in-git
-
git add --patch path/filename y stage this hunk for the next commit n do not stage this hunk the next commit q quit; do not stage this hunk or any of the remaining ones a stage this hunk and all later hunks in the file d do not stage this hunk or any of the later hunks in the file g select a hunk to go to / search for a hunk matching the given regex j leave this hunk undecided, see next undecided hunk J leave this hunk undecided, see next hunk k leave this hunk undecided, see previous undecided hunk K leave this hunk undecided, see previous hunk s split the current hunk into smaller hunks e manually edit the current hunk ? print help
-
Cherry Pick
-
git log yourbranch git cherry-pick <commit hash>
-