https://github.com/b1f6c1c4/git-fancy-push
The Ultimate Solution towards "shallow update not allowed" in git push
https://github.com/b1f6c1c4/git-fancy-push
git git-push github
Last synced: 10 months ago
JSON representation
The Ultimate Solution towards "shallow update not allowed" in git push
- Host: GitHub
- URL: https://github.com/b1f6c1c4/git-fancy-push
- Owner: b1f6c1c4
- License: mit
- Created: 2020-06-01T22:52:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-07T22:26:46.000Z (over 5 years ago)
- Last Synced: 2025-02-09T02:31:30.647Z (about 1 year ago)
- Topics: git, git-push, github
- Language: Shell
- Homepage:
- Size: 10.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `git-fancy-push`: "shallow update not allowed" _killer_
> The ULTIMATE solution towards "shallow update not allowed" during a git push
:worried: :frowning: :anguished:
Ever seen this is your life? Got annoyed?
:anguished: :frowning: :worried:
```bash
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:...
```
:wink: :kissing_smiling_eyes: :stuck_out_tongue:
Here is your solution!
:stuck_out_tongue: :kissing_smiling_eyes: :wink:
(**Guranteed no hidden `--unshallow`. Instant upload to GitHub.**)
```bash
# 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](https://stedolan.github.io/jq/)
- `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