Open coder0107git opened 7 months ago
I can confirm this, also the related #1963
I tried changing my git email with
git config --global user.email "my@mail.com"
or
git config user.email "my@mail.com"
in the terminal, but this seems to make the terminal hang. I can only exit the command with ^C back to the bash prompt with no mails changed.
👋 we have a fix in the way, @SamVerschueren is working on it
Yes exactly. We're working on it but can't give an ETA yet on when it will land.
Thank you! I've gotten stuck on project recently because I had made a few commits, couldn't push. Couldn't rebase to change the author of those commits either because I the terminal version of git doesn't have a rebase command.
You can save this as push.sh and execute, or you can simply paste it.
You can find your github commit email here: https://github.com/settings/emails
Add to your .gitignore because you don't want to push this dirty hack to the repo, if you prefer to save it.
Use it at your own risk. I'm not sure what side effects this might have. I added "&&" to have some extra reassurance, but I'm not a pro at bash scripts
git config --global user.email "EMAIL GOES HERE" && \
git config --global user.email && \
git add -A && \
git commit -m "COMMIT MESSAGE" && \
git push
If you prefer to save, paste this to execute it: chmod +x push.sh && ./push.sh
Will the fix land anytime soon? I want to use stackblitz codeflow but I can't get it to use my GitHub private email. The workaround doesn't work, it hangs the terminal and after using ^C, nothing happens to the commit email (it's still the same).
edit: I've found a workaround using the simple-git
npm package. Paste this in a js file that you can run using node then commit from the command line (not the IDE).
// RUN THIS ON A NEW STACKBLITZ INSTANCE AND USE THE COMMAND LINE TO PUSH
import { simpleGit } from "simple-git"
// this apparently breaks without this wrapper, even for type=module in package.json
(async () => {
try {
const git = simpleGit()
await git.addConfig("user.email", "insert email", false, "global")
await git.addConfig("user.name", "insert name", false, "global")
console.log("Done setting config!")
} catch (e) {
console.log("Uh oh, something went wrong...")
console.error(e)
}
})()
Description
On Codeflow (may also apply to Webflow or Classic editor, haven't tested on those though), pushing commits fails if you have the Github setting "Keep my email address private" enabled. This is basically the same issue as #1963 and gitpod#387.
Steps to Reproduce
Note: All of this is through the UI, not the command line (although it probably applies to the command line too).
Expected Behavior
Be able to push commits.
Work around