Skip to content

The Ultimate Solution towards "shallow update not allowed" in git push

License

Notifications You must be signed in to change notification settings

b1f6c1c4/git-fancy-push

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

git-fancy-push: "shallow update not allowed" killer

The ULTIMATE solution towards "shallow update not allowed" during a git push

😟 😦 😧 Ever seen this is your life? Got annoyed? 😧 😦 😟

git push origin master
## To github.com:...
##  ! [remote rejected] master -> master (shallow update not allowed)
## error: failed to push some refs to 'git@github.com:...

😉 😙 😛 Here is your solution! 😛 😙 😉

(Guranteed no hidden --unshallow. Instant upload to GitHub.)

# Get jq
(which pacman  && sudo pacman  -S      jq) ||
(which apt-get && sudo apt-get install jq) ||
(which brew    &&      brew    install jq)
which jq
# Get git-fancy-push
mkdir -p ~/.local/bin/ && curl -o ~/.local/bin/git-fancy-push https://raw.githubusercontent.com/b1f6c1c4/git-fancy-push/master/git-fancy-push
which git-fancy-push || export PATH="$HOME/.local/bin:$PATH"
# Do the push
git fancy-push origin master
## ...
## Notice: Push successful! (to ...)
## ...

Usage

The CLI is 100% compatible with that of git push. You just replace git push with git fancy-push. Of course, you need to put the git-fancy-push script in your PATH some where. It will start fixing the problem once you encounter a "shallow update not allowed" problem.

If you enounter problem, you can add --verbose as the first argument for git-fancy-push, like this: git fancy-push --verbose origin master

Dependency

  • jq - here
  • bash
  • git
  • curl
  • awk

Internals

git-fancy-push is based on GitHub v3 API. It recursively reads the commits that are not yet on GitHub and upload it using GitHub API.

Limitation

  • It will only work for GitHub. Both git@github.com: or https://github.com/ will work. It won't work for file://, GitLab, BitBucket, etc. If you want support for other platforms, create an issue or pull request.
  • It will fail on commits with a mergetag header, which will be added by newer versions of Git during merging a signed annotated tag.

License

MIT

About

The Ultimate Solution towards "shallow update not allowed" in git push

Topics

Resources

License

Stars

Watchers

Forks

Languages