dr jerry
dr jerry

Reputation: 10026

git push and pull branches

This question has been asked a few times but i haven't found my specific use case: I do have a nas which has gitosis and serves as a git master. I have a laptop and a desktop, on the laptop I do have a branch sandbox which I want to share via the nas on to the desktop. I tried git

git push sandbox : sandbox (: sandbox being redundant) 

which failed. Checking out sandbox and doing

git push origin HEAD

reports:

* [new branch]      HEAD -> sandbox

Now on the desktop I do:

git remote show origin

and I see the new branch:

Remote branches:
master tracked
sandbox new (next fetch will store in remotes/origin)

That's promising so now I want to pull the remote branch sandbox into my workspace on the desktop with:

git fetch origin sandbox (in the master branch)

it logs:

 * branch            sandbox      -> FETCH_HEAD

but branch sandbox is not created when I show the branches. Is there something trivial i'm missing? I also tried pulling but that also does not work as expected. regards, Jeroen.

Upvotes: 1

Views: 408

Answers (1)

VonC
VonC

Reputation: 1323135

sandbox should be listed if you do a:

git branch --all

You need to checkout said remote branch to track it locally

git checkout --track origin/sandbox

Then a simple git branch would show that branch.

Upvotes: 1

Related Questions