When using mirror repository, Application expects repos to be identical
See original GitHub issueDescription
When remotes differ and (1) repo contains unmirrored commits or (2) current branch is not mirrored. “Sync/Fetch/Publish button” displays “Publish branch/repository” even if commits/branch has been just been pushed successfully.
Version
GitHub Desktop version: 1.0.12
OS version: Win 10
Steps to Reproduce
- Clone public repo. _Example: https://github.com/desktop/desktop.git_
- Set push remote to a mirror repository. Example:
$ git remote set-url --push origin https://github.com/oiyouyeahyou/desktop.git
- Create branch new branch
- Click “Sync” button
- Observe changes should be on “push” mirror repo. Yet application still believes the branch needs to be published
Expected behaviour: Application recognises when split remotes are being used
Actual behaviour: Application does not register that changes are not symmetrical between mirror repos
Reproduces how often: 100%
<small>Sorry for inelegant Title</small>
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Mirror one repo to another when they exist on the same ...
Is it possible to mirror one repository/project in GitLab to another project in GitLab when both projects are in the same place/server/host ...
Read more >Repository mirroring · Workflow · Help · GitLab
Repository Mirroring is a way to mirror repositories from external sources. It can be used to mirror all branches, tags, and commits that...
Read more >Duplicating a repository - GitHub Docs
To maintain a mirror of a repository without forking it, you can run a special clone command, then mirror-push to the new repository....
Read more >Blocked mirror for repositories error when building from ...
Solution. This issue can be resolved by adding mirror repositories (using mirrorOf) to the ~/.m2/settings.xml file to redirect the mirrors ...
Read more >Maven repository and mirror with the same ID - Stack Overflow
In a project I wanted to use the same ID for a repository and mirror to avoid duplicating my credentials: pom.xml <repositories> ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can share a bit more about the root problem here, but I’m not sure if this is something we can fix.
Here’s my fork setup with the split
fetch
andpush
URLs on the single remote:When I push the new branch in Desktop, it passes
--set-upstream
and completes without error:But if you do a
git status
again you’ll see this message:And while this doesn’t sound right, we can ask git what branches it can see:
It only has the current branch in it’s list, without the remote ref associated with it.
This is the core of the problem - by using a different
push
URL for a remote, the operations that use thefetch
URL of a remote will no longer see these refs.I can run
ls-remote
and confirm this suspicion:Note the first line of the output - it’s using the
fetch
URL for theorigin
remote for this operation, which doesn’t contain the ref.Let’s see if @OiYouYeahYou can share some more information about their use case, and maybe there’s a different way for us to address this in the app.
Closing due to inactivity. @OiYouYeahYou if you can provide some more context on your use case we can discuss this further.