Basically i cannot see a branch on a different computer. I run
git branch -a
and on home computer I get
C:\learn ror\sample_app [filling-in-layout]> git branch -a
* filling-in-layout
master
static-pages
remotes/origin/filling-in-layout
remotes/origin/master
remotes/origin/static-pages
On the work pc I get almost the same result, except the "filling-in-layout" branches(local and remote).
What should I do?
To share branches, you need to push your branches on the machines where they're created, and setup remote tracking branches on the other machines:
Try this, on the machine that has the branch:
git push -u origin <branch name>
and this on the machine that doesn't:
git fetch
git checkout <branch name>
Git will automatically set up a remote tracking branch named <branch name>
if you try to check out a branch that only exists on a remote.
When you create a tag or a branch in your machine, and when you want to share your tag or your branch in remote repository, you have to push the tag or branch in the same way you push the repository.
$ git checkout -b new-branch
[...]
$ git add .
$ git commit -m 'Some stuff'
$ git push origin new-branch
And the same with a tag:
$ git tag 6.7
[...]
$ git push origin 6.7
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