wolfgang ziegler


„make stuff and blog about it“

7 snips use the tag Git

Git Linux

Persist your git credentials on Linux.

git config --global credential.helper store

Git

Undo the last local (not yet pushed) commit.

git reset --soft HEAD~1

Git

Turn off page output (globally) for git commands (e.g. "git branch").

git config --global pager.branch false

Ignore modified files due to changes in file permissions.

git config core.fileMode false
Git

Revert single files that you just committed.

git checkout HEAD~1 -- <path1> <path2>

Git Linux

From time to time I clean up all the local branches that have assembled over time in a Git repository.

git branch | grep -v "main" | xargs git branch -D

Git

Clear your git credentials (e.g. after a password change).

git config --unset user.password