mbostock / gistup

Create a gist from terminal, then use git to update it.
Other
488 stars 41 forks source link

gistup fails when local default branch doesn't match `main` #41

Closed bgschiller closed 3 years ago

bgschiller commented 3 years ago

github has changed the default branch name of new gists to main. On my local machine, new repositories name new branches master (as is currently the default).

Since these don't match, I get the following error:

Error: Command failed: git push -fu 'origin' main
error: src refspec main does not match any
error: failed to push some refs to 'gist.github.com:227fc9570dad5bacc46e21eed19985f8.git'

    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1047:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
  killed: false,
  code: 1,
  signal: null,
  cmd: "git push -fu 'origin' main"
}

I was able to recover by running

git branch -m main
git push -fu origin main
bgschiller commented 3 years ago

nvm, looks like #40 already fixed this, it just isn't published yet.