software/git
Git
Quick tip: when you have .gitignore
ignoring everything (with a *
entry), you need to use git-update-index --add FILE
to actually add the file, instead of just git-add FILE
.
Over HTTP
To make a repository available over "dumb" HTTP, set up a bare repository and copy hooks/post-update.sample
to hooks/post-update
.
To add links from gitweb, add to the @git_base_url_list
list in the configuration file.
Copying Files Between Repositories with History
Create a branch with only python files (slow; ignore the very verbose "won't delete directory" output):
git checkout -b filtered-commits git filter-branch -f --prune-empty --tree-filter 'find . -not -iname "*.py" -exec rm {} ;' filtered-commits
In the receiving repo:
git pull path/to/source/repo
See also:
http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/ http://superuser.com/questions/164362/git-keep-changelog-for-file-when-moving-to-a-different-repository
Color
git config --global --add color.ui true
Change Author Email in Recent Commits
For the most recent commit, use:
git commit --amend --author="First Last <user@example.com>"
To edit specific commits, use rebase -i and "edit" the commits you want to change and use --amend as above for each.
Managing Multiple Repositories
Use the mr tool (I haven't tried this yet).