DEV Community

Discussion on: Spooktober: Git Horror Story

Collapse
 
rhymes profile image
rhymes • Edited

It felt embarrassing, as I am a junior dev. And I've been working with git commands for 3 years so far.

Don't worry, we all forget commands :-)

The thing is git clone creates a copy of the repository on your local machine pointing to the HEAD. In this copy you have the entire history and all the branches, develop included.

Once cloned you could have switched branch from master to develop by issuing: git checkout develop

git clone -b develop URL is, I think, a shortcut of the two commands.

Collapse
 
moopet profile image
Ben Sinclair

Once cloned you could have switched branch from master to develop by issuing: git checkout develop

That's what they described doing, isn't it?

Collapse
 
rhymes profile image
rhymes

Yeah, I forgot about the origin part :-)

Johanathan's answer is more complete