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.

Pull and Sync fails when name of tracking branch differs from name of tracked branch on remote

See original GitHub issue

Issue Type: Bug

I have several branches that have another name, or rather path, in the upstream repository, e.g. local branch foo pushes to and fetches from branch path/to/foo in the upstream repository. But the tracking branch is upstream/foo, so the tracking branch path doesn’t reflect the upstream branch path.

With this setup, the git.pull and git.sync commands fail with a message “Git: fatal: couldn’t find remote ref foo”.

Studying the code, I found that the bug is either at extensions/git/src/git.ts, lines 1462 - 1470, https://github.com/Microsoft/vscode/blob/c63c97c12848e85769e717209b73110e83c18ef6/extensions/git/src/git.ts#L1462-L1470 or at extensions/git/src/repository.ts, lines 924, 944 and 1006, https://github.com/Microsoft/vscode/blob/c63c97c12848e85769e717209b73110e83c18ef6/extensions/git/src/repository.ts#L924 https://github.com/Microsoft/vscode/blob/c63c97c12848e85769e717209b73110e83c18ef6/extensions/git/src/repository.ts#L944 https://github.com/Microsoft/vscode/blob/c63c97c12848e85769e717209b73110e83c18ef6/extensions/git/src/repository.ts#L1006

Should the name field in the upstream object really be the name of the remote tracking branch? Shouldn’t it be the name of the tracked branch on the remote? Or should the upstream object contain another field storing the name of the tracked branch on the remote which then should be used at extensions/git/src/repository.ts, lines 924, 944 and 1006?

VS Code version: Code 1.31.1 (1b8e8302e405050205e69b59abb3559592bb9e60, 2019-02-12T02:20:54.427Z) OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel® Core™ i7-6500U CPU @ 2.50GHz (4 x 2592)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 7.89GB (0.31GB free)
Process Argv c:\Users\perpe\OneDrive - Adaptive Simulations Sweden AB\Source\VSCode Workspaces\NewPostProcessing.code-workspace
Screen Reader no
VM 0%
Extensions (55)
Extension Author (truncated) Version
calculate aca 2.1.0
Bookmarks ale 10.2.2
project-manager ale 10.3.2
code-gnu-global aus 0.2.2
awarest-align awa 1.1.0
path-intellisense chr 1.4.2
ssh chr 0.0.4
bracket-pair-colorizer Coe 1.0.61
vscode-markdownlint Dav 0.25.0
empty-indent Dmi 0.2.0
vscode-gitignore-syntax dun 0.1.2
gitlens eam 9.5.1
tslint eg2 1.0.43
hungry-backspace ekl 1.0.0
prettier-vscode esb 1.8.1
vscode-pyvmmonitor fab 0.0.3
file-icons fil 1.0.16
matlab Gim 0.9.0
todo-tree Gru 0.0.124
rest-client hum 0.21.2
python-coding-conventions igr 0.0.4
latex-workshop Jam 6.1.0
vscode-jira Kni 0.6.0
rest-client Kro 0.18.3
git-tree-compare let 1.5.0
Star lip 0.0.3
remotefs lix 0.0.13
vscode-smart-column-indenter lmc 0.0.13
vscode-3dviewer md2 1.0.0
rainbow-csv mec 1.0.0
git-graph mhu 1.4.1
vscode-deploy-reloaded mkl 0.87.2
vscode-remote-workspace mkl 0.41.0
prettify-json moh 0.0.3
python ms- 2019.2.5558
cpptools ms- 0.21.0
Go ms- 0.9.2
printcode nob 3.0.0
indent-rainbow ode 7.3.0
vscode-code-outline pat 0.2.1
vscode-versionlens pfl 0.22.0
material-icon-theme PKi 3.6.3
quicktype qui 12.0.46
datetime rid 1.0.5
vscode-paste-and-indent Rub 0.0.8
copy-text sal 0.4.3
gitconfig sid 2.0.0
open-file-between-two-folder sky 0.0.1
vscode-hexdump sle 1.7.2
python tht 0.2.3
hosts tom 1.1.1
python-extended-snippets tus 0.0.1
vscodeintellicode Vis 1.1.4
vscode-todo-highlight way 1.0.4
pull-requester yos 0.1.5

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
joaomorenocommented, Mar 18, 2019

Yup, I understand it now.

The way I see us fixing this is just to remove the arguments passed to git pull. Not sure I would do this for everyone though… so maybe a setting?

0reactions
md2perpecommented, Mar 14, 2019

Did you follow my instructions to reproduce?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't update: no tracked branch - Stack Overflow
where I have a single branch in my repo called master. The response was "Branch master set up to track remote branch master...
Read more >
Git - Remote Branches - Git SCM
Remote -tracking branch names take the form <remote>/<branch> . ... To synchronize your work with a given remote, you run a git fetch...
Read more >
Sync with a remote Git repository (fetch, pull, update) - JetBrains
Select the branch from which you want to pull changes into the branch that is currently checked out. By default, the remote branch...
Read more >
Remote tracking branches — Git Memo v1.1 documentation
The default when creating a branch from a remote is to track the remote, but when you create a branch from an other...
Read more >
git checkout remote branch – How to, Examples and Options
by convention git creates the local branches with same name as remote branch names and after git fetch you can checkout the remote...
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