2

I know 2 options of git commands,

  • shallow clone, which is fast forked but unable to push
  • sparse checkout, which is able to commit and push, but not fast enough when initializing

With Github, we can also edit single file contents online. But how about multiple files?

Can someone give a best practice?

Machavity
  • 30,841
  • 27
  • 92
  • 100
chinesedfan
  • 259
  • 1
  • 2
  • 9
  • Do you mean `shallow clone` by `shadow clone`? Why is it unable to push? – ElpieKay Dec 04 '19 at 03:44
  • 1
    @ElpieKay Fixed the typo. I failed when using `--depth 1`. And you reminded me to search a little more. I will try a larger depth next time. – chinesedfan Dec 04 '19 at 03:59

1 Answers1

1

I mentioned in 2014 that since Git 1.9, a shallow clone would be able to push back.

If your initial clone has not enough depth, you can use git fetch --deepen to increase it, until a push succeeds.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250