Is it possible to make git clone do git clone --recursive by default?
Asked
Active
Viewed 2,294 times
21
-
@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 Answers
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
-
1Interesting. 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
-
2
-
5This does not answer the question and should not have been accepted. – einpoklum Dec 04 '17 at 20:37
-
1FYI, 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