Search code examples
windowsgittortoisegitgit-remotegit-checkout

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?


Solution

  • 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.