top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

Why can't I push from a shallow clone in Git

+2 votes
306 views

I've been trying to figure out why I can't push from a shallow clone (using --depth) to a repository. I've made simple examples where it works, but I've read that in doesn't work in every case. However, I can't come up with a case where it doesn't work. Googling gives this answer: http://stackoverflow.com/questions/6900103/why-cant-i-push-from-a-shallow-clone,

but I don't completely understand the explanation,Please explain.

posted Jul 26, 2013 by Ahmed Patel

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

2 Answers

+1 vote

I can't explain it better than what Junio did in the link you just provide. However there's ongoing work to allow shallow clones to be able to push. You can read about it here:
http://thread.gmane.org/gmane.comp.version-control.git/230612/focus=230878

answer Jul 26, 2013 by Mandeep Sehgal
0 votes

See also this thread [1] which originated from this SO question [2].

  1. http://thread.gmane.org/gmane.comp.version-control.git/221634
  2. http://stackoverflow.com/q/16077691/720999
answer Jul 26, 2013 by Salil Agrawal
Similar Questions
+1 vote

I wanted to avoid push if any of the files is deleted from the local git clone area. Can anyone please help me with that?

I am using Stash for repository management.

0 votes

Is there any reason why 'git clone -b' only takes a branch (from refs/heads/) or a tag (from refs/tags/) ?

Background: At $dayjob we're using some kind of 'hidden' refs (in refs/releases/) to communicate between the 'branch integrator' (who creates the ref in refs/releases/) and the 'build master' who wants to build that ref.

It would be a little easier if the build master could simply say

git clone -b refs/releases/the-release-for-today URL
instead of: git clone... ; cd ... ; git fetch... ; git checkout....

Any answer or even a better idea to solve that is appreciated.

+3 votes

When we clone a remote GIT repository, all folders/files will be cloned. This will consume lot of disk space in our local machine.
Is there a way to clone only few folders & exclude others?

This is possible in clearcase snapshot view by changing load rules.

+1 vote

I want to connect my android studio with git and installed git separately and when I enable version control. There is an error
"Cannot run program "git.exe" The system cannot find the file specified" searched in C drive programs files and X86 too but didn't get git.exe location.


Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#470/147, 3rd Floor, 5th Main,
HSR Layout Sector 7,
Bangalore - 560102,
Karnataka INDIA.
QUERY HOME
...