-
-
Save gitex/ba255304efdd1e688e33d9da5b9fac9c to your computer and use it in GitHub Desktop.
Fix for cleaning a repository when: "error: Couldn't set refs/heads/branchName"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
git gc --aggressive |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment