Reputation: 3319
I am working with tortoisegit and have a local repository where i have configured a remote repository for fetching and pushing the code.
Now i add a new branch to the remote repository. Then, from my local repository, i execute a "fetch" from the remote repository. The expectation is that the new branch is fetched and can then be merged.
But instead the branch is ignored by Tortoisegit. I'm trying it via Windows Explorer > Right click > TortoiseGit > Fetch. There i cannot select the new branch, so when i execute the fetch, the new branch is not fetched. The new branch is not tracked.
How can i get Tortoisegit to recognize new remote branches? I can only add and remove remotes in the settings, but i cannot configure ref-specs?
Upvotes: 6
Views: 12992
Reputation: 11
You may just want to switch to the new branch as I did. To do that, via Windows Explorer > Right click > TortoiseGit > Switch/Checkout. Then select branch for "Switch To", make sure Option are correctly selected accordingly, such as "Create New Branch", "Overwrite working tree changes(force), and/or other applicable options. With these I was able to switch to the new branch that I couldn't through Git Sync window.
Upvotes: 1
Reputation: 920
I already had a similar problem, maybe that's because I cloned a repo a specific branch with depth 1, so no other branches were referenced in the local repository history. Solution was to re-clone the repo without depth 1 option.
Upvotes: 0
Reputation: 99
Suppose your remote is set to 'origin'. Now, when you execute git fetch, all the branches under 'origin' are fetched to your local. To fetch a branch, no need to select that specific branch.
Upvotes: 8