On the local machine I work in a branch, for example localbranch. In this thread, I finished some function. And so! Done! Now I want to go to the develop branch, and smadzhit it, but since I added only the localbranch branch to the local machine ( git clone --single-branch -b localBranch *url* ) and now I want to go to the develop branch . But I have cloned only one branch, and when I switch to git, it will give me that there is no such wreath (it is understandable, it lies on a remote repo) .
What am I doing in this case. I delete the project I clone develop, after I do merge localBranch.
And, I need that would not have something to remove. And, you just need to add a branch to an existing local repository.
Essentially git clone --single-branch -b develop *url* but in the same folder.
I tried to load the master branch assuming that all existing branches are downloaded from it, but alas not. Should there be a way to add a branch without deleting the existing one?
git branch -u upstream/foo fooorgit checkout -b <branch>. But I am very much knocked down by the fact that with one hand you say that you locally do not have a branch that is on the server (develop is on the server, but not locally), then with the other hand you endure "into an already existing locally" with the other hand. Let us figure it out in yourself, put the question in order, and you will not shout with a bolt — this does not help understanding a lot. Do you see for yourself that one part of the question contradicts another? - AK ♦git statusandgit branch -a- I assure you, it would be much more understandable. - AK ♦git statusandgit branch -ain my opinion is not clear. I wrote that the branch that is needed not on the local repo means it would not exist in thegit branch -aeither. It would seem to me all confused only. Yes, and the answer was given (reshu)! Just what you need. - EugeneTM