Is it possible to checkout a branch using the command line (terminal on mac) knowing just:
ssh://[email protected]:8000/abc/somename.git
You have to clone this repository first using
git clone ssh://[email protected]:8000/abc/somename.git
This will be creating a local working copy of this project and will be on the default branch of it what is probably 'master'
You can verify which branch you are on using
git status
If you want a list of the available branches (in the remote repo) execute
git branch -r
If you want another remote branch available on your local copy you can use
git checkout --track origin/remotebranchname
The --track parameter will tie your local branch and remote branch together so you won't have to be give it explicitly when pushing your code for example.
Create the branch on your local machine and switch in this branch :
$ git checkout -b [name_of_your_new_branch] [name_of_the_origin_branch]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With