Cloning a specific Git branch is very easy and most of us don't required at all. But this is a very practical ask if your Repository have too many branches or having a big repo with lots of artifacts in it.
1. Older Way (Do not use):
$ git clone https://github.com/atulsingh0/git-learn.git$ git checkout developThe problem with above commands is, It will clone the whole repo with all the branches and then switch to your branch in ask.
2. Little Better Way (Do not use because its a replica of Older Way):
$ git clone -b develop https://github.com/atulsingh0/git-learn.gitThis is same as Older Way, the only difference is, you need to execute one command rather then two.
3. New Way:
$ git clone -b develop --single-branch https://github.com/atulsingh0/git-learn.gitLike the below page to get the update
Facebook Page Facebook Group Twitter Feed Telegram Group

No comments:
Post a Comment