Seltene git-Probleme lösen

()

origin verändern

git remote set-url origin ...
# HTTPS
git remote set-url origin https://...
# SSH
git remote set-url origin git@...

Branch Alias anlegen

git symbolic-ref refs/heads/acc refs/heads/acceptance

Umlaute (non-ASCII) in git status

git config --global core.quotePath false

Quelle

git merge Konflikte lösen

git format-patch -10 HEAD --stdout > 0001-last-10-commits.patch
git format-patch commitx..HEAD --stdout > 0001-commits.patch
git apply 0001-commits.patch

Commit-Datum anpassen

DATE="$(date +%F) 17:10:35"
GIT_COMMITTER_DATE=$DATE GIT_AUTHOR_DATE=$DATE git commit -a

Reset des letzten Commits, Änderungen behalten

git reset --soft HEAD~1
git reset --soft HEAD^

Fehler: cannot lock existing

git pull
error: cannot lock existing
git remote prune origin

Git and nasty “error: cannot lock existing info/refs fatal” - Stack Overflow