Comments (3)
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 syncsmain
of local repository with themain
of parent repository. My local repository'smaster
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.
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.
Thanks for confirming. For now, I'll close this issue.
from cli.
Related Issues (20)
- Revisit generation of `completions` on macos during release process
- Sign Mac OS Installer packages HOT 1
- Document our our release process
- `gh pr merge` using stale branch policy verdict HOT 5
- Download a release only if newer
- use `gh create release -F <note-file> <version>` command created release has default title is `Merge pull request #1 from ...` HOT 1
- improve gh repo set-default to work with remote names HOT 1
- Fedora Repo: latest version is 2.45 (actually 2.50) HOT 4
- `gh pr list` doesn't write output anywhere if stdout or stderr is piped HOT 18
- `gh run view 9313418737 --log-failed` gives no output for a failed run HOT 2
- random auth changes? HOT 4
- Trying to build on EC2 instance, receive errors parsing go.mod, unknown directive: toolchain error HOT 3
- `panic: reflect: call of reflect.Value.Interface on zero Value` when `gh pr view --json stateReason` HOT 1
- Create issue with assignee login prefixed with `@` fails repeatedly HOT 1
- Cannot use fine-grained PATs to add labels to pull requests HOT 12
- Add a --latest flag to `gh run download` HOT 1
- Add a --wait flag to `gh run download`
- Delete caches by pattern
- Copilot Chinese Support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.