2

I have been pulling and pushing my project to TFS from Visual Studio 2017 for a while now. Until recently, I cannot pull from the remote repo

I get this error:

Git failed with a fatal error. pull --verbose --progress --no-edit --no-stat --recurse-submodules=no origin

I have tried different ways to solve this

  1. From Team Explorer/Settings/Repository Settings, I checked override global username and email and manually entered the credentials for that repo --didn't fix it

  2. I reinstalled Git from Visual Studio installer --didn't fix it

Note: This is happening to every project I try to pull or push in my VS (even projects that are not in TFS)

How can I fix this?

Sayo Babalola
  • 990
  • 14
  • 25
  • 1
    The very first thing I would check is `git status` from the Git bash. This should tell you what is really happening under the hood. – Tim Biegeleisen Jun 09 '18 at 03:08
  • I forgot to mention that I used git bash to pull and the push to the origin but somehow it didn't pull or push even when I got a positive response from git bash – Sayo Babalola Jun 09 '18 at 03:18
  • Checking my git status ==> `$ git status On branch working Your branch and 'origin/working' have diverged, and have 1 and 3 different commits each, respectively. (use "git pull" to merge the remote branch into yours) nothing to commit, working tree clean ` – Sayo Babalola Jun 09 '18 at 03:19

2 Answers2

1

Considering the local and remote branching have diverged, you could setup Git to "do the right thing" (which is to rebase your local work on top of the remote branch). See "Can “git pull” automatically stash and pop pending changes?"

git config --global pull.rebase true
git config --global rebase.autoStash true

That way, TFS should do a git pull (as you mention) which in this case you fetch origin/working, and rebase working on top of origin/working.
This is easier than using Visual Studio to do the same rebase.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

You have changed your TFS password and thats not updated in user account in control panel update your tfs account password in user account Control panel -> User account -> Manage your credential -> Window credentials

find here tfs url like tfs.***.com and click on edit and update put your tfs account password here . now restart your system and now can try