{"thread":{"id":"21426","subject":"Tracking a remote branch in git","startedAt":"2009-10-29T19:45:46Z","lastAt":"2009-10-30T00:26:20Z","messageCount":2,"participants":["Sips","Tim Mazid"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"126327","messageId":"26119537.post@talk.nabble.com","threadId":"21426","inReplyTo":null,"subject":"Tracking a remote branch in git","fromName":"Sips","fromEmail":"kirillosipov@msn.com","sentAt":"2009-10-29T19:45:46Z","receivedAt":"2009-10-29T19:45:46Z","isPatch":false,"sender":{"key":"kirillosipov@msn.com","avatar":null},"body":"\nHello everyone.\nMy git setup is as follows:\n\nOne local repository residing at D:\\Dev\\ProjectName\nOne remote repository residing at W:\\ProjectName\n\nW is actually a removable disk.\n\nNow, both repositories are connected through remotes. For example, git\nremote -v in the local repository gives:\n\nstorengo    W:\\ProjectName (fetch)\nstorengo    W:\\ProjectName (push)\n\nThe same command in the remote repository gives:\n\norigin    D:\\Dev\\ProjectName (fetch)\norigin    D:\\Dev\\ProjectName (push)\n\nObviously, when I am in the master branch, I can synchronize repositories\nbetween each other through git push and git pull.\n\nThen I created a branch in the repository on the removable drive W and named\nit newfeature. The question is: How can I work with this branch on the local\nrepository as well? I mean, I need the same 'relationship' between branches\nas in case of the master branch.\n\nI tried the following command on the local repository (which was checked out\nto the master branch at that time):\n\ngit branch --track newfeature storengo/newfeature,\n\nbut received an error fatal: Not a valid object name: 'storengo/newfeature'.\n\nWith this command I was hoping to create a local branch which would be\n'connected' to the same remote branch. As I've said, no luck there.\nStrangely, the following command works without errors:\n\ngit branch --track newfeature storengo/master.\n\nI mean, I am able to track the master branch from the remote repository. Why\ncan't I track some other branch as well? Any ideas what I'm doing wrong?\n\nThanks,\nKirill\n-- \nView this message in context: http://www.nabble.com/Tracking-a-remote-branch-in-git-tp26119537p26119537.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"126345","messageId":"26123156.post@talk.nabble.com","threadId":"21426","inReplyTo":"26119537.post@talk.nabble.com","subject":"Re: Tracking a remote branch in git","fromName":"Tim Mazid","fromEmail":"timmazid@hotmail.com","sentAt":"2009-10-30T00:26:20Z","receivedAt":"2009-10-30T00:26:20Z","isPatch":false,"sender":{"key":"timmazid@hotmail.com","avatar":null},"body":"\n\nSips wrote:\n> \n> Then I created a branch in the repository on the removable drive W and\n> named it newfeature. The question is: How can I work with this branch on\n> the local repository as well? I mean, I need the same 'relationship'\n> between branches as in case of the master branch.\n> \n> ...\n> \n> I mean, I am able to track the master branch from the remote repository.\n> Why can't I track some other branch as well? Any ideas what I'm doing\n> wrong?\n> \n\nHave you tried doing 'git fetch'? That should get and track all new remote\nbranches automatically.\n\nOnce you have a remote branch, if you've deleted the local branch, you can\njust do 'git branch LOCAL REMOTE', and that should set up a tracking branch.\n\nIf this doesn't work for you, check your git version with 'git --version'.\nIt works for v1.6.5.2.\n\nGood luck,\nTim.\n-- \nView this message in context: http://www.nabble.com/Tracking-a-remote-branch-in-git-tp26119537p26123156.html\nSent from the git mailing list archive at Nabble.com.\n"}]}