my personal dot files, snippets and others things

View the Project on GitHub 69pmb/DotFiles

1. Divers

2. Reset

3. Stash

4. Log

5. Dots

6. Filter-repo

Divers

git commit -m "Something terribly misguided"
git reset HEAD~
<< edit files as necessary >>
git add ...
git commit -c ORIG_HEAD
git diff -w --no-color
git apply --cached --ignore-whitespace
git checkout -- .
git reset

Reset

Stash

Log

Custom local configuration

Create a .gitconfig file in the repository root
Then include manually the config file:
git config --local include.path "../.gitconfig"

Author Vs Committer

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

Dots

<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.

Filter-repo

Name 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>
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.

BFG Cleaner

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