git remote show origingit remote prune origingit push -d origin <branch>git branch -d <branch>git commit -m "Something terribly misguided"
git reset HEAD~
<< edit files as necessary >>
git add ...
git commit -c ORIG_HEAD
git rebase -i --rebase-merges HEAD~git checkout -b [name_of_your_new_branch]git checkout <rev> -- file/to/restoregit log --no-merges master..git diff --cachedgit show --name-only <rev>git log --graph --oneline --decorate $( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )git add -p:git checkout --patchgit blame <file> <rev>git gui blamegit in another directory:git <cmd> -C <path>git update-index --assume-unchanged <path>git bisect <last_good_hash>git add ./\*.jsongit clean -fgit diff -w --no-color
git apply --cached --ignore-whitespace
git checkout -- .
git reset
git rebase -X theirs <branch>ours or theirs):git checkout --ours <file>git reset HEAD [path]git reset <file>git reset --hardgit reset <hash> --softgit stash save <message>git stash -ugit stash listgit stash cleargit stash push -m <name> <path>git stash show -pgit log --followgit log -- path/to/foldergit log -i -Gtext --name-onlygit log --all --grep='text'Create a .gitconfig file in the repository root
Then include manually the config file:
git config --local include.path "../.gitconfig"
Author => write the code
Committer => commit the code
The author is the person who originally wrote the patch, whereas the committer is the person who last applied the patch
<rev1>..<rev2>
Include commits that are reachable from <rev2>
but exclude those that are reachable from <rev1>.
When either <rev1> or <rev2> is omitted, it defaults to HEAD.
<rev1>...<rev2>
Include commits that are reachable from either <rev1> or <rev2>
but exclude those that are reachable from both.
When either <rev1> or <rev2> is omitted, it defaults to HEAD.
git filter-repo --analyze.git\filter-repo\analysispath-deleted-sizes.txtgit filter-repo --force --invert-paths --path-glob "path/to/file"git remote add origin https://github.com/xxx/zzz.git and then git push --forcegit filter-repo --mailmap mailmap.txtName For User <email@addre.ss>
<new@ema.il> <old1@ema.il>
New Name And <new@ema.il> <old2@ema.il>
New Name And <new@ema.il> Old Name And <old3@ema.il>
git filter-repo --replace-text exp.txtexp.txt containing:p455w0rd
foo==>bar
glob:*666*==>
regex:\r\n \* @author xxx==>
regex:\bdriver\b==>pilot
literal:MM/DD/YYYY==>YYYY-MM-DD
regex:([0-9]{2})/([0-9]{2})/([0-9]{4})==>\3-\1-\2
will go through and replace p455w0rd with REMOVED, foo with bar, any line containing 666 with a blank line, the word driver with pilot (but not if it has letters before or after; e.g. drivers will be unmodified), replace the exact text MM/DD/YYYY with YYYY-MM-DD and replace date strings of the form MM/DD/YYYY with ones of the form YYYY-MM-DD. Every line has a replacement, given by whatever is on the right of ==>. If ==> does not appear on the line, the default replacement is REMOVED. If multiple matches are found, all are replaced.
Download the jar here: https://rtyley.github.io/bfg-repo-cleaner/
Clone the full repo, amke a copy of it:
git clone --mirror
Put the data to remove in a text file and then:
java -jar bfg.jar --replace-text passwords.txt
All the commits and branch will have this data removed except the HEAD.
Pull requests will not be modified