Code Monkey home page Code Monkey logo

Comments (3)

arunsathiya avatar arunsathiya commented on June 18, 2024 1

It still corrects that my master default branch was synced instead of my main.

No error; also the synced branch was my master not main as shown above.

Unless I'm doing something wrong, I'm not seeing the describe behavior.

When I run the sync command, the branch that's synchronized on my local repository is the one of the same name as the parent repository's default branch. In my case:

  • Local repository's default branch is master
  • Parent repository's default branch is main
  • Running gh repo sync on my local repository syncs main of local repository with the main of parent repository. My local repository's master is not synchronized, as your experience seems to suggest.
 cli-9146 git:(master) ls
README.md


 cli-9146 git:(master) git remote -vv
origin	[email protected]:arunsathiya/cli-9146.git (fetch)
origin	[email protected]:arunsathiya/cli-9146.git (push)
upstream	[email protected]:arunwp/cli-9146.git (fetch)
upstream	[email protected]:arunwp/cli-9146.git (push)


 cli-9146 git:(master) gh repo set-default
This command sets the default remote repository to use when querying the
GitHub API for the locally cloned repository.

gh uses the default repository for things like:

 - viewing and creating pull requests
 - viewing and creating issues
 - viewing and creating releases
 - working with GitHub Actions
 - adding repository and environment secrets



? Which repository should be the default? arunsathiya/cli-9146
✓ Set arunsathiya/cli-9146 as the default repository for the current directory


 cli-9146 git:(master) gh repo sync
✓ Synced the "master" branch from arunsathiya/cli-9146 to local repository


 cli-9146 git:(master) gh repo set-default
This command sets the default remote repository to use when querying the
GitHub API for the locally cloned repository.

gh uses the default repository for things like:

 - viewing and creating pull requests
 - viewing and creating issues
 - viewing and creating releases
 - working with GitHub Actions
 - adding repository and environment secrets



? Which repository should be the default? arunwp/cli-9146
✓ Set arunwp/cli-9146 as the default repository for the current directory


 cli-9146 git:(master) gh repo sync
✓ Synced the "main" branch from arunwp/cli-9146 to local repository


 cli-9146 git:(master) git branch
  main
* master


 cli-9146 git:(master) ls
README.md


 cli-9146 git:(master) gh repo sync
✓ Synced the "main" branch from arunwp/cli-9146 to local repository


 cli-9146 git:(master) ls
README.md


 cli-9146 git:(master) git checkout main
Switched to branch 'main'
Your branch is up to date with 'upstream/main'.


 cli-9146 git:(main) ls
New-README.md

The renaming of README.md to New-README.md is the synchronized change, and as we can see, it happened on the main branch as expected, not on master.

Could you double-check this behavior at your end? 🤔

from cli.

arunsathiya avatar arunsathiya commented on June 18, 2024

I tried with gh CLI v2.45.0 and I see the same behavior as I do with the latest version:

 cli-9146 git:(master) /Users/arun/Downloads/gh_2.45.0_macOS_arm64/bin/gh repo s
ync
✓ Synced the "main" branch from arunwp/cli-9146 to local repository


 cli-9146 git:(master) ls
README.md


 cli-9146 git:(master) git checkout main
Switched to branch 'main'
Your branch is up to date with 'upstream/main'.


 cli-9146 git:(main) ls
Third-README.md

So overall, I am not seeing a bug in neither the sync behavior nor a typo in the output message after the sync command is executed. I wonder what might be happening at your end.

from cli.

bagustris avatar bagustris commented on June 18, 2024

@arunsathiya

Thanks for confirming. For now, I'll close this issue.

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.