question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Action to take when remote branch is moved?

See original GitHub issue

First off, I apologize if this is the incorrect medium to bring this up.

Somebody decided it would be a great idea to re-organize the folders on our TFS server such that the location to which my git-tfs remote is currently pointing no longer exists. As such, I can no longer commit or shelve. Additionally, pulling just results in a repository with no files.

Is there a way to resolve this without re-cloning and replicating the un-committed work on the new repo?

I tried setting the ‘tfs-remote.default.repository’ config value to point at the new location, but that didn’t seem to get me much closer - if I issue the ‘git tfs branch’ command, I get the following output:

[master]> git tfs branch

Git-tfs remote details:

 default -> http://mytfsinstance:8080/tfs $/New/Path/To/Main
Unable to locate a remote for <http://mytfsinstance:8080/tfs>$/Old/Path/To/Main
You may be able to resolve this problem.
- Try using `git tfs bootstrap` to auto-init TFS remotes.
- Try setting a legacy-url for an existing remote.

So I’m wondering - is there a good way to ‘move’ where the git-tfs remote is pointing?

git-tfs version 0.19.1.0 (TFS client library 12.0.0.0 (MS)) (32-bit)

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jnm2commented, Aug 30, 2019

@pmiossec this was a tremendously helpful thread after trying several other ways to continue cloning from a fixed commit. Adding an empty commit “Renamed branch ProductName to master” with a git-tfs-id of the new URL and the changeset number and editing .git/config worked.

0reactions
pmiosseccommented, Aug 30, 2019

@jnm2 Thanks for the follow-up

Read more comments on GitHub >

github_iconTop Results From Across the Web

move existing, committed work to a new remote branch in git
The three commands git branch -m , git fetch , and git branch --set-upstream-to have no effects at all upon your existing index...
Read more >
How do I move the pointer of a remote branch to another ...
Reverting a commit creates a new commit which completely undoes the changes in the original commit. If you did git revert <hash of...
Read more >
How to push new Git branches to remote repos on GitHub ...
Simply use a git push origin command on subsequent pushes of the new branch to the remote repo. New branch to remote Git...
Read more >
Apply changes from one Git branch to another
In the Branches popup or in the Branches pane of the Git tool window select a branch and choose one of the following...
Read more >
git switch and git checkout – How to switch branches in git
To checkout a remote branch, you will need to fetch the contents of the branch using git fetch –all first. Then use the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found