Can't seen my branches on a different pc

I'd like to mention at the start that I come from a pure TFS background and I am used to workspaces and branching like its done there. I have recently decided to give TFS GIT a shot and I am seeing some strange behavior. This might be normal in the GIT world or I might be doing something wrong, so lets see. Questions in bold below.

I created a project on my desktop in folder C:projectBase and checked this into my origin/Master branch. On TFS I confirmed that my changes are in. Now after this I moved to my laptop and cloned my repository in D:OfficeWorkProjectCode. After some changes I branched into Origin/DEV locally and pushed this local branch into the server by checking it in. I confirm again that the changes are on the TFS server by going into the code section of the TFS website. On the server I now can see both master and DEV branches.

Now I come back to another desktop and try to clone my repository into C:Codebase. Now I can only see changes upto the last changes made in origin/Master. Visual Studio also shows me only the Origin/Master branch. Why is this happening? Why doesnt it show me the DEV branch as well? . That is still my branch that I created. I am using the same domain login on all three systems.

I now run this git command: git checkout origin/DEV This updates my local codebase in c:Codebase with the latest changes I made in DEV. But now in TFS why cant I see the branch origin/DEV? If I make some changes on this new desktop and want to later work on the laptop or some other machine with the same changes I made on this new desktop, what do I need to do?

Don't ask why I am shifting between so many different pcs :) Thanks.


I think you might have a fundamental misunderstanding of how distributed version control works -- "ORIGIN" refers to the remote repo (in this case, TFS). You want to clone the TFS repo (which sets it up as ORIGIN on your machine), then work locally . Don't check out origin/dev, checkout just "dev" -- origin/dev is the remote repo's version of that branch, dev is in your local version of that branch. That's why you can't see origin in TFS -- TFS has no origin, it is the origin.

In order to get the latest changes from the remote repo into your repo, you have to do a pull .

链接地址: http://www.djcxy.com/p/26150.html

上一篇: 从中央仓库创建本地分支的标准方式是什么?

下一篇: 无法在其他电脑上看到我的分支