git tfs fetch: not updating (beginner question)

247 views
Skip to first unread message

Jan Catrysse

unread,
May 28, 2021, 8:32:10 AM5/28/21
to git-tfs-dev

Hello all.

Subject:
"git tfs fetch --all" is not updating my local copy of a TFS repository.

Context:
I do not have TFS experience, nor GIT experience.
I just want to have a GIT clone of a TFS project to make it available in Redmine, a project management tool like Jira.

Problem:
I cannot see any newer changesets when browsing my local git repository (using Remine).

What did I do:
I cloned the project, and I am doing a "fetch" on a daily basis. But in Redmine I cannot see any changesets newer than the original clone. I presume I need to merge something, but I don't know how. I can see files/directories updating in the .git directory but nothing in my file tree.

Afterwards (after multiple fetch commands) I tried a "pull" but that did not help me.
I also tried "git merge FETCH_HEAD" and some clean-up commands...

Commands:
git tfs clone --branches=all https://tfs.xxxx.xx/tfs/Project $/branch/to.clone c:\local_dir
cd c:\local_dir && git tfs branch –init --all
cd c:\local_dir && git tfs fetch --all
cd c:\local_dir && git tfs pull --all -r

Am I doing something wrong? Maybe I do not understand how "git" is working.
The main thing is that I want to have a local git repository including all commits and I want to keep it up to date.

Thank you.

Matt Burke

unread,
May 29, 2021, 12:23:01 PM5/29/21
to git-t...@googlegroups.com

Commands
:
git tfs clone --branches=all https://tfs.xxxx.xx/tfs/Project $/branch/to.clone c:\local_dir
cd c:\local_dir && git tfs branch –init --all
cd c:\local_dir && git tfs fetch --all
cd c:\local_dir && git tfs pull --all -r


Starting with 'git tfs clone' is right. You shouldn't need to do 'git tfs branch --init --all' afterwards, though. Once you have a good clone, 'git tfs fetch' will maintain what Git calls a "tracking branch". Tracking branches represent a snapshot of a remote repository so that you can work with changes from there without needing to make calls to the remote repository.

'git tfs pull' is similar to 'git tfs fetch' plus 'git merge <tracking branch>'. In other words, 'git tfs pull' starts by updating local tracking branches ('git tfs fetch') and then merging the default branch into your local checkout ('git merge').

After you run the commands above, you might want to run 'git branch -av' to show each branch (including tracking branches) along with the commit message from the latest commit on each branch.

I hope that helps!

--
Matt

Jan Catrysse

unread,
Jun 1, 2021, 4:02:35 AM6/1/21
to git-tfs-dev
Thank you Matt. I restarted with a clone and now a pull... but the problem is the same.

However, maybe a hint on the cause?
Using the command 'git branch -av' I get a list of the local branches with the latest commit message on the 28th (day of the clone), and for the remote branches the correct latest commit message.
The master branch is up to date.
So it would be like the latest commits on other than master branches are not coming in, even when I see some action going on when I am doing the pull command...

What would be the raison behind that?

'git tfs pull --all --branches=all -r' did not change the issue...

When doing a 'git branch -av --no-merged' I get the same list, except for the master branch... is something going wrong with the merge?

Best regards,
Jan

Op zaterdag 29 mei 2021 om 18:23:01 UTC+2 schreef matt:

Jan Catrysse

unread,
Jun 1, 2021, 4:04:34 AM6/1/21
to git-tfs-dev
Some (cleaned) example output for 'git branches -av'

  xxx-2020R2                                ec43967849 242674 CHE : XXXWEB : Create connectionstring for Xxxx to open archived documents
  xxx-2020R3                                21ff08a44b 241604 CHE : DEV: task Xxxx.Schedule.Labo.ImportLabResultsWithoutLabRequest and pop-up import lab results in medical examination
  xxx-2021R1                                83ff22894e 244272 CHE : DEV: bookmark 'ResultsVO2'
  xxx-2021R2                                2e6e7ac75f 243453 KUP : DEV - view Informationrequests - contectmenuitem is not active after first SAVE/CREATE
  xxx-2021TK                                4b45174ae9 231542 KUP : DEV : renew controlsuite in xxxxxxxxxx winforms application. Telerik Theme.
  xxx-Master                                e1b4fc6481 243453 KUP : DEV - view Informationrequests - contectmenuitem is not active after first SAVE/CREATE
* master                                    ccc8cc7a15 242674 CHE : XXXWEB : Create connectionstring for Xxxx to open archived documents
  remotes/tfs/xxx                           13c2ddbac7 227830 KUP : DEV : CustomerFS : store count of employees of complete customerfamily on customerfs of mainseat
  remotes/tfs/xxx-2020R2                    ec43967849 242674 CHE : XXXWEB : Create connectionstring for Xxxx to open archived documents
  remotes/tfs/xxx-2020R3                    21ff08a44b 241604 CHE : DEV: task Xxxx.Schedule.Labo.ImportLabResultsWithoutLabRequest and pop-up import lab results in medical examination
  remotes/tfs/xxx-2021R1                    289fb79de6 226223 KUP : DEV : Scheduled tasks : Provide possibility to configure the path of logfile in parametertable paths
  remotes/tfs/xxx-2021R2                    7e65973dc5 231600 KUP : DEV - Xxxx - Convocation documents
  remotes/tfs/xxx-2021TK                    4b45174ae9 231542 KUP : DEV : renew controlsuite in xxxxxxxxxx winforms application. Telerik Theme.
  remotes/tfs/xxx-Master                    39077be509 231600 KUP : DEV - Xxxx - Convocation documents
  remotes/tfs/xxx-Previous                  3f9750c88c 210761 KUP : DEV: Make PlanningFields from Shared library thread safe
  remotes/tfs/xxx-Previous2                 9317b5f916 203226 ADE : DEV: Invoicing - sum DetailTotalInclusiveVAT
  remotes/tfs/default                       ccc8cc7a15 242674 CHE : XXXWEB : Create connectionstring for Xxxx to open archived documents

Jan Catrysse

unread,
Jun 1, 2021, 11:55:24 AM6/1/21
to git-tfs-dev
I understand now that the merge is only on the tracking branch and not ALL branches.
I still need to do a 'checkout' on each other branch and merge again.

Op dinsdag 1 juni 2021 om 10:04:34 UTC+2 schreef Jan Catrysse:

Matt Burke

unread,
Jun 1, 2021, 12:06:15 PM6/1/21
to git-t...@googlegroups.com
On Tue, Jun 1, 2021 at 11:55 AM Jan Catrysse <jan.ca...@gmail.com> wrote:
I understand now that the merge is only on the tracking branch and not ALL branches.
I still need to do a 'checkout' on each other branch and merge again.

Ah, yeah. That's true. If you just want to see changes on each of the branches, you can do something like 'git log -p refs/tfs/xxx-2021R1' and see the changes related to that branch. But if you want to be able to check it out locally, you'll want to do like what you said and 'git checkout xxx-2021R1' then 'git merge remotes/tfs/xxx-2021R1'.

--
Matt
Reply all
Reply to author
Forward
0 new messages