Git is a software for tracking changes in any set of files.
It works best for non-binary text files
Manage multiple repositories
Find all child repositories
Pull all child repositories
Review and upload feature
rebase
: review all feature commitsreword
: rename commitsfixup
: combine commits into a single one
push
: upload current branch to remotepush
: integrate current branch into remote’s main branchfetch
: download remote branches
In case main changed and changes have to be merged, do so and run
Branch handling
Squash multiple commits into one before pushing
Push my branch to remote’s main branch
- abbreviate dirty:
git push origin $($(git branch --show-current).trim()+":"+(git symbolic-ref --short refs/remotes/origin/HEAD).replace("origin/",""))
Remove binaries from history
- Shrinks the repository size by excluding files or folders from the commit history.
- Rewrites all effected commits and their children to erase a folder/file from their changes.
- Avoid when collaborating, as it rewrites many commits.
Exclude a file
Exclude a folder and its content
Useful commands
Amend all changes to previous commit
Show git graph
Alias
Alias internal command
- and call it using
git amend
Alias external command
Sources:
- 2022-12-14: Creating Git shortcuts
- 2023-06-19: git: Was ihr an der Uni noch nicht über die Versionsverwaltung gelernt habt. Ein praxisorientierter Workshop.
Related:
Tags:
Computer Language
https://github.com/JohannesKaufmann/html-to-markdown
https://github.com/dandavison/delta
Introduction - Mergiraf https://mergiraf.org/