GIT checkout branch via terminal
·
Answer a question
Is it possible to checkout a branch using the command line (terminal on mac) knowing just:
ssh://git@dev.somename.se:8000/abc/somename.git
Answers
You have to clone this repository first using
git clone ssh://git@dev.somename.se: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.
更多推荐


所有评论(0)