简体   繁体   中英

How do I set git up to keep my files in sync?

I'm having a problem with getting my Git repository to function the way that I want it to. I'm sure it can do what I want, but I'm just not figuring it out on my own. Here's my setup...

  • PC1: This is my dev machine where I created the repository, and make changes to it.
  • SERVER1: This is where my remote Git repository is located, and all changes are pushed to it from PC1.
  • PC2: This is my QA machine. I cloned the Git repo from SERVER1. I wish to checkout whatever branch I want to test from the remote repository, and be able to do pulls to get the latest code.

I use TortoiseGit on both PCs. I created a branch (2012_2_2) on PC1, committed changes, and pushed to SERVER1. From PC2, I selected "Switch/Checkout", and checked out remotes/orgin/2012_2_2.

Sadly, this doesn't work. When I look at the properties of the PC2 repository, the Current Branch say "fatal: ref HEAD is not a symbolic link". Also, I am unable to pull changes made to branch 2012_2_2. When I select pull from the menu, the only branch available to pull from is origin/master.

Where did I go wrong?

I got it. There's a check box in Tortoise when you do the Switch/Checkout for creating a branch. I was unchecking that thinking that I didn't need to create the branch. Leaving it checked solved my problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM