-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Git push #191
Improve Git push #191
Conversation
Bear in mind, this won't work on Windows unless using WSL. |
This reverts commit 41543d5.
This reverts commit 41543d5.
Thanks @owenvoke for the heads up. Reverting this. |
@owenvoke How does this break on Windows outside of WSL? I've just tried this in PowerShell: PS C:\Users\mislav\gh-cli> $env:GIT_TERMINAL_PROMPT=0
PS C:\Users\mislav\gh-cli> $env:GIT_TRACE=1
PS C:\Users\mislav\gh-cli> git -c credential.helper= -c credential.helper='!gh auth git-credential' push
22:27:41.451926 exec-cmd.c:237 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
22:27:41.451926 git.c:447 trace: built-in: git push
22:27:41.451926 run-command.c:667 trace: run_command: GIT_DIR=.git git remote-https origin https://github.com/cli/cli
22:27:41.467552 exec-cmd.c:237 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
22:27:41.467552 git.c:734 trace: exec: git-remote-https origin https://github.com/cli/cli
22:27:41.467552 run-command.c:667 trace: run_command: git-remote-https origin https://github.com/cli/cli
22:27:41.483174 exec-cmd.c:237 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
22:27:41.733443 run-command.c:667 trace: run_command: 'gh auth git-credential get'
22:27:42.021091 run-command.c:667 trace: run_command: 'gh auth git-credential store'
Everything up-to-date You can see that Note:
|
It works if you use
The issue isn't so much the following command, but the fact that Windows tries to run |
Is there any way we can write the line so it can work on every Windows environment? I have zero knowledge of working with Windows so would be cool if anyone could paste that here or send in a PR. |
I'm not familiar with Symfony, but it looks like environment variables should be passed as a separate argument: https://symfony.com/doc/current/components/process.html#setting-environment-variables-for-processes With that syntax, processes should likely work across platforms. |
Looks perfect, I'll test it in a bit once I'm off lunch. 👍🏻 |
After talking to some of my GitHub contacts they gave me a tip for a safer way to do a
git push
after creating the GitHub repo. Doing so will allow us to remove the note about thegh_protocol
in the docs as it won't matter anymore what protocol you use.