3

I want to reset to the state of a remote.

Using normal git I would do something like git reset --hard origin/HEAD.

I am using git-tfs. Does anyone know how to do this with git-tfs?

Ben Aston
  • 53,718
  • 65
  • 205
  • 331

2 Answers2

6

The solution was working out how git-tfs constructs the remote URI.

In my case the following worked:

git reset --hard tfs/default

Ben Aston
  • 53,718
  • 65
  • 205
  • 331
  • Maybe a stupid question, but what is 'tfs' and what is 'default' for you? As I am getting: ambiguous argument 'tfs/default': unknown revision or path not in the working tree. – corgrath Feb 12 '13 at 11:56
  • 1
    `[tfs-remote "default"] url = http://foo.com:8080/tfs/project/ repository = $/project/subproject fetch = refs/remotes/default/master username = domain\\username password = mypassword` – Ben Aston Feb 12 '13 at 13:30
  • ^ above is from my git config file (under .git directory) – Ben Aston Feb 12 '13 at 13:30
0

I found the following "built in" git tfs reset-remote, I dont know if this is what you wanted to do Ben? https://github.com/git-tfs/git-tfs/blob/master/doc/commands/reset-remote.md

Konstantin
  • 3,626
  • 2
  • 33
  • 45