21

Is it possible to make git clone do git clone --recursive by default?

Sahand
  • 1,965
  • 16
  • 23
  • @TylerH: Almost, but the answer here is worth saving, and it wouldn't quite fit there. – einpoklum Dec 07 '17 at 15:29
  • @einpoklum fair point, but questions closed as duplicates are not deleted by the Roomba, as they act as useful signposts. – TylerH Dec 07 '17 at 15:30

1 Answers1

14

No, it is not possible, see:

Is it possible to override git command by git alias?

However, you can define a similar instead:

git config --global alias.cloner "clone --recursive"

then

git cloner http://localhost/yyy.git
einpoklum
  • 102,731
  • 48
  • 279
  • 553
linquize
  • 19,090
  • 9
  • 57
  • 80
  • 1
    Interesting. I had ``alias glone="git clone --recursive"`` in my bashrc file but I think I prefer this. I didn't know you could alias git commands. Thank you. – Sahand May 26 '14 at 20:16
  • 1
    @Sahand I believe that's not possible, actually: http://stackoverflow.com/questions/5916565/#comment6812824_5916565 – Seldom 'Where's Monica' Needy Feb 14 '17 at 23:26
  • 6
    Despite this being accepted, it does not answer the question. – einpoklum Apr 13 '17 at 13:36
  • 2
    This is a bad answer, doesn't answer the question. Voted down. – Jez Aug 02 '17 at 17:58
  • 5
    This does not answer the question and should not have been accepted. – einpoklum Dec 04 '17 at 20:37
  • 1
    FYI, the question was mentioned on [the meta](https://meta.stackoverflow.com/questions/360219/question-with-accepted-answer-not-answering-the-question-and-no-actual-answer#comment538001_360219). Despite this is a good *alternative*, this answer fails to answer the direct question: "is it possible to use the *same command* `git clone` to clone recursively?". You might want to expand the answer to that question. – Andrew T. Dec 07 '17 at 14:57
  • I dunno, "No, it is not possible" seems like a direct answer to that question. – Jeff Hammond Sep 09 '21 at 06:57
  • @JeffHammond That was only added to the answer *after* these comments... – Борат Сагдиев Jan 21 '22 at 18:21