1

My question is quite simple but I can't find any solution.

I use electron-react-boilerplate for a project, so I cloned it using ---depth=1. Then, I was failing to push my changed to my own origin (a BitBucket repo), because I was developping on a shallow repo.

So I used git fetch --unshallow upstream (upstream being the boilerplate origin), however, as expected, it loaded all the commits from the boilerplate, which I don't want.

This makes the git tree dirty, is there a way to reverse the git fetch --unshallow command ? Reflog gives nothing. Moreover, why did I need the unshallow in the first place, since I was already pushing on my own repo ?

Eric Burel
  • 1,828
  • 1
  • 18
  • 34
  • Git has long-supported `git fetch --depth=...` as both *in*crease and *de*crease the depth of a clone: i.e., it now (but did not always) sets a fixed depth. It is, however, not clear to me just how that affects any commits *you* may have made (I see some ways it can be defined well and would hope Git uses those but this may be Git-version-dependent). There are still limitations on *pushing* from shallow clones, though: see http://stackoverflow.com/q/6900103/1256452 – torek Mar 27 '17 at 15:57

0 Answers0