Skip to content

Instantly share code, notes, and snippets.

View gitex's full-sized avatar
🏠
Working from home

Evgeniy Dorovatovskiy gitex

🏠
Working from home
  • Kazachstan
View GitHub Profile
@gitex
gitex / git-failed-to-push.sh
Last active April 27, 2020 10:05 — forked from OmeGak/git-failed-to-push.sh
Fix for cleaning a repository when: "error: Couldn't set refs/heads/branchName"
# Solves:
# error: Couldn't set refs/heads/branchName
# To X:xxx.git
# ! [remote rejected] branchName -> branchName (failed to write)
# error: failed to push some refs to 'X:xxx.git'
git fsck —unreachable
git reflog expire —expire=0 —all
git repack -a -d -l
git prune