How can I see in my local repository a recently created branches in the Bitbucket repository?

走远了吗. 提交于 2019-12-12 18:06:27

问题


I am just trying to import the branch 'brancTest' recently created in Bitbucket into my local repository.

This is what I am doing git checkout -b 'brancTest' origin/brancTest And I get this message:

fatal: 'origin/brancTest' is not a commit and a branch 'brancTest' cannot be created from it 

I am in my develop an git status give me this:

git status  
On branch develop
Your branch is up-to-date with 'origin/develop'.
nothing to commit, working tree clean

When I do git branch -a I can't see 'brancTest' in the list of all branches.

How to import that branch?


回答1:


git fetch
git checkout brancTest



回答2:


Try "git remote -v" to verify if any remote named 'origin' listed in it.

If you don't find 'origin', that is the remote (which should have been created by default while cloning a repo) is missing.

Add origin again in that case using below:

git remote add origin url/to/your/fork



来源:https://stackoverflow.com/questions/47142602/how-can-i-see-in-my-local-repository-a-recently-created-branches-in-the-bitbucke

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!