alicederyn / git-sync Goto Github PK
View Code? Open in Web Editor NEWSynchronize local git repository with all remotes
Synchronize local git repository with all remotes
If git-sync
is run when the user has a PR branch out, with local changes to files, and the PR has merged, the resulting fast-forward (#8) overwrites the local changes.
If the branch is no longer on the commit merged to HEAD, git-sync
will still "fast-forward" the branch.
github.py, line 115, in fetch_pull_requests_from_domain
pr_data["headRepository"]["sshUrl"],
TypeError: 'NoneType' object is not subscriptable
Running git sync
today, I got the error:
Traceback (most recent call last):
File "~/.local/bin/git-sync", line 8, in <module>
sys.exit(main())
File "~/.local/pipx/venvs/git-sync/lib/python3.10/site-packages/git_sync/__init__.py", line 62, in main
branches = branches_with_remote_upstreams()
File "~/.local/pipx/venvs/git-sync/lib/python3.10/site-packages/git_sync/__init__.py", line 25, in branches_with_remote_upstreams
return [
File "~/.local/pipx/venvs/git-sync/lib/python3.10/site-packages/git_sync/__init__.py", line 27, in <listcomp>
for name, upstream in (line.split(b" ") for line in raw_bytes.splitlines())
ValueError: too many values to unpack (expected 2)
This is parsing the output of git branch --format="%(refname) %(upstream)"
; when I run this, I get the output:
(no branch, rebasing remove.breg.378983)
refs/heads/main refs/remotes/upstream/main
refs/heads/remove.breg.378983 refs/heads/main
This initial line seems to be the problem. A better plumbing command to use appears to be:
git for-each-ref --format="%(refname) %(upstream)" refs/heads
If the current branch's upstream is a remote branch, but the remote branch has been deleted, git pull --all
fails.
Possible solution: Split the git pull --all
command into a fetch and (after verifying the remote branch still exists) a command (tbd) that does the fast-forward of pull.
Current workaround: checkout a different branch before running git-sync
.
Our firm has a VPN, and connections to github need to go via a proxy. We don't configure that proxy globally as it is only needed for certain sites. It would be nice if git-sync looked for an environment variable ($GITHUB_PROXY
?) and passed it into the GraphQLClient.
It's common when working on a PR to merge in changes to the main branch via the UI, creating a merge commit. It would be great if git-sync
would fast-forward those commits into the relevant branch, so that subsequent work on the branch is compatible.
If you run git sync
with uncommitted changes on a branch with remote changes (e.g. on main
with tool-created changes to .gitignore
, in my case), you get an error:
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.
Traceback (most recent call last):
...
The issue is that the stack trace is quite long, obscuring the user error and making it look like a tool failure.
github squash commits aren't understood by git (e.g. git branch -d x
will error saying x is not merged). It would be great if git-sync
would check github for PR activity associated with the user's branches, and fast-forward any branches to the associated merge commit. This would solve basically every complaint I have about squash commits!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.