pr:git-stuff
Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
Git-Tricks
Commit-Datum ändern (z.B. Import alter Code)
GIT_AUTHOR_DATE='Wed Dec 19 15:14:05 2029 -0800' git commit -m 'future!' GIT_AUTHOR_DATE='2029-12-19 15:14:05 -0800' git commit -m 'future!' GIT_AUTHOR_DATE='`date -Iseconds -u -R "oldest file"`' git commit -m 'past!'
Unterverzeichnisse rausziehen
To rewrite the repository to look as if foodir/ had been its project root, and discard all other history:
git filter-branch --subdirectory-filter ABC --prune-empty -- --all
Remove directory from history:
git filter-branch --index-filter "git rm -q -r -f --cached --ignore-unmatch ABC" --prune-empty -- --all
Mit Subtree:
## create branch that tracks only MyLibraryRepo/* git subtree split -P MyLibraryRepo -b export ## make new repo cd ~/Projects mkdir LibraryRepo cd LibraryRepo git init # copy over commits... git fetch ../bigrepo export # ... and define master as them git checkout -b master FETCH_HEAD
Changelog
git log --format="- %B" --reverse Previous-Release..HEAD
pr/git-stuff.1454709801.txt.gz · Zuletzt geändert: 2016/02/05 23:03 von martok