threads / discuss / 54183

Sequent repos ,, pull without checkout

Subject: Sequent repos ,, pull without checkout

## tl;dr

2 messages between Sep 3, 2020 and Sep 3, 2020.

replies: 1people: 2as markdown or json

Wolfgang Graf· Sep 3, 2020, 06:38 UTC · lore
What did you do before the bug happened? (Steps to reproduce your issue)

We have three repos bt,bt2,bt3 where bt2 is a clone of bt and bt3 is a clone of bt2. All remote destinations remain unchanged (pointing to the repo before).

Step 1: I'm creating a branch "b11" in bt, committing it. Step 2: Going to bt2, doing git pull --all. Step 3: Going to bt3, doing git pull --all.

What did you expect to happen? (Expected behavior)
The branch b11 is usable in bt3 also
What happened instead? (Actual behavior)

Either doing Step 2a: If I'm doing a git checkout b11 in bt2 before Step 3 The branch b11 is also usable in bt3 This works

or doing Step 2b: If I'm doing a fetch by name 'fetch origin master:master bt11:bt11" This works

But if I'm only pushing through from bt to bt3 without doing checkout in bt2 the b11 is no more usable in bt3 when omitting step 2a or2b

What's different between what you expected and what actually happened?

The pull output did show me that there changes are tracked. But only if a checkout in bt2 in the middle was made before the content of the changes made within the origin change are really coming through to bt3

Anything else you want to add:

This might not be necessarily a bug. If this behavior is intended please close it. It would be instead of that be nice if some guideline would exist to deal with changes wired through a cascade of repositories in different branches. As seen on the internet many people are asking for a solution for that.

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.28.0.windows.1 cpu: x86_64 built from commit: 77982caf269b7ee713a76da2bcf260c34d3bf7a7 sizeof-long: 4 sizeof-size_t: 8 shell-path: /bin/sh uname: Windows 10.0 18362 compiler info: gnuc: 10.2 libc info: no libc information available $SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe

[Enabled Hooks] -

Kind regards
Wolfgang
wg@wogra.net
-- 
**
I prefer signed and encrypted email messages.
If you are able to recieve encryted messages please let me know.
**
Raymond E. Pasco· Sep 3, 2020, 22:25 UTC · re: Wolfgang Graf · lore

Re: Sequent repos ,, pull without checkout

This is the expected behavior. The branches in a repository (what you see when you run "git branch" with no arguments") are different from the remote-tracking refs (what you see when you run "git branch -r", and which are updated by "git fetch"). You can't track another repository's remote-tracking refs with your remote-tracking refs, just its actual branches.

The part which may be confusing is that "git checkout", as a shortcut, lets you attempt to check out a branch that does not exist, and if a branch with the same name exists on a remote, it will create the branch and set it up to track that remote branch.

If you wanted to fetch branches from multiple other repositories, though, you would ordinarily add those repositores as remotes, rather than pushing everything through a single existing remote.

Hope that helps.

← back to recent threads