0

I'm trying to push my local branch (Dev) up to my git repo so that when someone else clones the repo, they will have the Dev branch as a local one.

So far, when you clone the repo and run git branch -a you get this:

master
remotes/origin/Dev
remotes/origin/master

but what I want the person to get is this:

Dev
master
remotes/origin/Dev
remotes/origin/master

I've tried git push --all but that didn't help. I've tried a few other things but I can't remember them all and I'm willing to try them again.

Also, My Dev local branch tracks to the Dev remote branch.

Bobo
  • 976
  • 2
  • 10
  • 25
  • Duplicate of [Only master branch is visible after cloning a Git repo](http://stackoverflow.com/questions/8889753/only-master-branch-is-visible-after-cloning-a-git-repo) –  Jun 22 '14 at 03:15

1 Answers1

0

There is no provision in Git to do that. The other person will have to create a local copy of your branch by:

git checkout -b Dev origin/Dev

what this does is to create a local branch named 'Dev' which tracks the remote branch 'origin/Dev'. So essentially, both you and the other person have individual copies of the remote branch. And whenever you or the other person push, it gets synced with the remote branch and the other person gets the changes while pulling. This is how Git is supposed to be used.

Mani
  • 61
  • 6