Git: track a remote branch

Here is the point: you have a git repository a random guy forked your repo and made a pull request You want to rework his contribution locally before merging it On your local repo, add the random guy forked repository address and name it random-guy: git remote add random-guy git@github.com:random-guy/your-project.git You can see the remote repo you added with this command: git remote show Add the remote branch where the random guy did the pull request and name this branch pr-rework (for Pull Request rework)....

<span title='2022-06-07 00:00:00 +0000 UTC'>June 7, 2022</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;JC

Memo git config

Everytime I configure a new PC or env, I search for this: git config --global user.name "John Doe" git config --global user.email "johndoe@domain.tld" git config --global gpg.program gpg git config --global pull.ff only git config --global commit.gpgsign true git config --global init.defaultBranch main git config --global push.default current git config user.email "johndoe@domain.tld"

<span title='2021-11-27 10:00:00 +0000 UTC'>November 27, 2021</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;JC

Memo vim config with powerline

Powerline install: sudo apt install powerline python3-powerline fonts-powerline Vim config: " All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by " the call to :runtime you can find below. If you wish to change any of those " settings, you should do it in this file (/etc/vim/vimrc), since debian.vim " will be overwritten everytime an upgrade of the vim packages is performed. " It is recommended to make changes after sourcing debian....

<span title='2021-11-27 10:00:00 +0000 UTC'>November 27, 2021</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;JC

Update author and email in git history

Imagine you have already made some commits in a git repo and you want to update your mail address and/or your name ? In short, you want to re-write git history with good informations. Here is a script who can do that. Put here in parent folder of git repo you want to edit: #!/bin/sh git filter-branch --env-filter ' OLD_EMAIL="incorrect-email@domain.tld" CORRECT_NAME="Your Name" CORRECT_EMAIL="good-email@domain.tld" if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] then export GIT_COMMITTER_NAME="$CORRECT_NAME" export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" fi if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ] then export GIT_AUTHOR_NAME="$CORRECT_NAME" export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL" fi ' --tag-name-filter cat -- --branches --tags This script will search for all commits done by incorrect-email@domain....

<span title='2021-02-24 14:41:02 +0000 UTC'>February 24, 2021</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;JC