Tags: :git:github:
git push origin dev
git push upstream utags:tags
git co -b dev origin/dev
git remote add upstream https://.../vimwiki/vimwiki.git
git diff --minimal --ignore-all-space
git diff --cached
git log --graph --decorate --pretty=oneline --abbrev-commit
git branch branch_name --set-upstream-to your_new_remote/branch_name
git --git-dir=/var/repo/one.git --work-tree=/var/work/one init
- then:
git --git-dir=/var/repo/one.git ...your-command
git remote set-url origin [email protected]:t7ko/jdotxt.git
git reset --hard 0d1d7fc32
git config user.name "Ivan Tishchenko"
- Stored in
.git/config
git reset --soft HEAD~1
-- keeps in indexgit reset --mixed HEAD~1
-- removes from index as well, but keeps in working copy
git reset
git reset -- README
-
to merge:
git fetch git://github.com/xxx/xxx.git branch_name && git merge FETCH_HEAD
-
to create a branch:
git fetch git://host.com/path/to/repo.git remote-branch-name:local-branch-name git checkout local-branch-name
git verify-commit # to check signature
git rebase --signoff HEAD~2 # sign last 2 commits
[alias]
## Usage: git signoff-rebase [base-commit]
signoff-rebase = "!GIT_SEQUENCE_EDITOR='sed -i -re s/^pick/e/' sh -c 'git rebase -i $1 && while git rebase --continue; do git commit --amend --signoff --no-edit; done' -"
http://stackoverflow.com/questions/4318161/can-git-pull-all-update-all-my-local-branches
plugin 'git-up'
git push origin --delete b1
git remote prune origin # purge
git push origin --delete `git br -a | grep '^ remotes/origin' | sed 's|^ remotes/origin/||' | grep -v '^HEAD' | grep -v '^main$' | head -n 20`
https://git-scm.com/book/en/v2/Git-Tools-Rerere
git config rerere.enabled true
FYI -
Here is the guide that I followed to move files while maintaining history: http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/
The only change was that I had to add --allow-unrelated-histories to the pull command (new git behavior).
- https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
- https://git-scm.com/docs/git-filter-branch
- https://github.com/newren/git-filter-repo/
- https://htmlpreview.github.io/?https://github.com/newren/git-filter-repo/blob/docs/html/git-filter-repo.html
- see --replace-text, there is an example
git filter-repo git filter-repo --invert-paths --path PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA
https://github.com/newren/git-filter-repo
https://rtyley.github.io/bfg-repo-cleaner/
bfg --delete-files YOUR-FILE-WITH-SENSITIVE-DATA bfg --replace-text passwords.txt
First let's assume your topic is based on branch next. For example, a feature developed in topic depends on some functionality which is found in next.
o---o---o---o---o master
\
o---o---o---o---o next
\
o---o---o topic
We want to make topic forked from branch master; for example, because the functionality on which topic depends was merged into the more stable master branch. We want our tree to look like this:
o---o---o---o---o master
| \
| o'--o'--o' topic
\
o---o---o---o---o next
We can get this using the following command:
git rebase --onto master next topic
Just like default but does not remove #commentary.
Does not modify message, leaves it as is.