Shallow update not allowed (git > 1.9)

There are a lot of answers stating that git 1.9 removes limitations of shallow clones. Nevertheless, I'm using 2.6.1 and still having the following basic issue:

First, I create an empty repo somewhere:

cd /tmp mkdir target cd target git init

Then, I shallow clone some repo and add the above repo as remote:

cd /tmp git clone --depth 1 git@github.com:muennich/urxvt-perls.git cd urxvt-perls git remote add target /tmp/target

Finally, I push this repo to the remote:

git push target master

But then I get:

! [remote rejected] master -> master (shallow update not allowed) error: failed to push some refs to '/tmp/target'

What am I missing here?


I'm answering my own question.

I tried going the other way around and adding urxvt-perls as a remote for target, then fetching from there. This fails because of the same reason but led me closer to a solution. From the git-fetch man:

--update-shallow By default when fetching from a shallow repository, git fetch refuses refs that require updating .git/shallow. This option updates .git/shallow and accept such refs.

Now, using this option allows the shallow fetch. So the previous question becomes: Is it possible to specify that --update-shallow behavior while pushing? Well, there is an option for that:

receive.shallowupdate If set to true, .git/shallow can be updated when new refs require new shallow roots. Otherwise those refs are rejected.

I'm still trying to set this in github and the likes, though.


Use git merge --squash.

If your remote is shallow and you want to merge from it, compress that merge into a single commit without the need to copy a history of commits (which shallow refs hide).


Well on Linux repo server... this

git config --local --add receive.shallowUpdate true

resulted in this being added to the repo config file.

[receive] shallowUpdate = true

So maybe if you can add that to the repo config file.


  • Running libxlsxwriter on Windows
  • how to extract EPG from dvb-t (live tv stream - udp) with ffmpeg?
  • installing modules when using perlbrew
  • JHipster Entity Generator crahing
  • LibGit2Sharp and Authentication UI
  • How to integrate CCAvenue to Ionic app?
  • How do I deploy application on sourcevoid with private git package dependencies?
  • Display Flycheck buffer (with errors) when saving
  • automate ssh-keygen for github in powershell
  • Google Cloud Builder - Gradle
  • Error:Execution failed for task ':app:dexDebug'. when importing ParseLoginUI as a module
  • OpenCV OpenNI calibrate kinect
  • Cloud Functions for Firebase with custom HTTP path
  • Facebook PHP SDK 3 won't work on 32-bit system, facebook ids treated as int and can be > 214
  • Google cloud datastore emulator init data
  • TypeScript DefinitelyTyped Ember.js d.ts doesn't compile
  • Timeout on a php Peg Puzzle solver
  • How to remote debug with Delve debugger in Visual Studio Code
  • Using docker environment -e variable in supervisor
  • Why do GeoJSON features appear like a negative photo of the features themselves?
  • RPMs for IDAS IoTAgents GE, from Fiware
  • Cythonized function unexpectedly slow
  • Passing parameter through “window.location.href”
  • Plotting Route with Multiple Points in iOS
  • iOS Localization Doesn't Work with More Than 63 Files
  • TFS - how do I sum child task hours to parent
  • ImportError: cannot import name Pubnub
  • How can we prepend rows to a react native list-view?
  • How to get links to open in the native browser in iOS Meteor apps?
  • Application level floating views with navigation in Android
  • How to generate and display a QR Code in ionic 2
  • Sonar maven jacoco code coverage for Multimodule project
  • Get history of file changes from TFS to implement custom “blame”-behaviour of exceptions
  • Paperclip, set path outside of rails root folder
  • Shallow update not allowed (git > 1.9)
  • jquery mobile loadPage not working
  • How do I rollback to a specific git commit
  • How to include full .NET prerequisite for Wix Burn installer
  • Revoking OAuth Access Token Results in 404 Not Found
  • Qt: Run a script BEFORE make