Git - nimrody/knowledgebase GitHub Wiki
-
Using git diff for non-repositories
git diff --no-index dira dirb -
Git diff show only modified files - not new files
git diff --diff-filter=M -
Alibaba - detailed explanation of underlying data structures and principles of git
-
Setup remote branch
$ git remote add nimrody nimrody.com:prj/tensera/mysql-monitor $ git push --set-upstream nimrody master
-
Add worktree to track remote branch
git worktree add -b rep ../rep origin/rep
-
Search all history for a regular expression
git rev-list --all
| xargs git grep expression git grep $(git rev-list --all) Use
-e <expr> --or -e <expr2>to search for two regular expressions
git update-index --assume-unchanged <filename>
And to show the ignored files:
git ls-files -v | grep '^[[:lower:]]'
- git-svn rebase
git checkout --ourgets the svn version,git checkout --theirsgets our local changes
-
See discussion here:
Recommended approach: Use
includeIf. In the local~/.gitconfig[user] name = Me Myself email = [email protected] signingkey = D34DB44F [includeIf "gitdir:~/src/github.com/work_org/"] path = ~/.gitconfig_workThen in
~/.gitconfig_work:[user] name = Me Myself email = [email protected] signingkey = D34DC0D4 [core] sshCommand = ssh -i ~/.ssh/work_ed25519