0

In a local repo, I staged all my changes and added a commit message. Then, I pushed my commits using magit-push and pushed to my branch upstream origin/master. Right after I do that, the mini-buffer said something like Git<1> finished. I have tried to setup the repo to use both https and ssh. When I use ssh, magit would ask for the passphrase like the example below. When I use https, it did not ask. Either way, both does not seem to push to github.

In the magit-process buffer, the log looks like this:

Pushing to github.com:username/reponame.git
Enter passphrase for key '......bla blah
To github.com:username/reponame.git
=[up to date]     master -> master
updating local tracking ref 'refs/remotes/origin/master'
Everything up-to-date

I then checked my github via web, and the changes are not pushed. After 5-10 minutes, the changes are still not pushed. Back to emacs, the magit-process buffer still said the same thing "Everything up to date". There are no messages/warnings in the message buffer.

If I try to forcefully quit emacs, I would get an error that an active process is running. There is another buffer that pops up and shows the process

  • name: git
  • PID number
  • status: run
  • buffer (magit-process)
  • command it runs is: git --no-pager --literal-pathspecs -c core.preloadIndex=true -c log.showSignature=false -c color.ui=false -c color.diff=false commit --

I have to forcefully quit emacs with xkill on Linux to close it. Otherwise, emacs would just stay there and try to run the above command (git --no-pager blah blah).

Note that if I try this on a Terminal, with your typical:

  • git add .
  • git commit -m "Some messages"
  • git push

Then it works for both ssh and https and I can see the updated changes on my github web. Any help is greatly appreciated.

1
  • Random punt but what are the SSH credentials used by Emacs for your repository?
    – slackline
    Commented Sep 6, 2021 at 22:57

1 Answer 1

1

Are you sure you finished the commit correctly? That command that is still running is git commit with some extra options, and the log indicates that git push didn’t have to update anything; the remote already had all the commits.

How did you start the commit, and how did you finalize it?

Edit: From the comments, I see that you saved the commit message, but you didn’t actually commit. Saving with C-c C-s does indeed save the message to disk, but only C-c C-c actually tells git to create the commit.

4
  • Hi, I just run M-x magit-commit, this opens up a buffer for me and choose to commit all (-a option). Then it opens up another buffer for me to type in the commit. I type in the commit, then save the buffer (C-x C-s). Then I run M-x magit-push.
    – mle0312
    Commented Sep 6, 2021 at 23:20
  • I just tried it again, and after saving the commits, I have to do C-c C-c, then run M-x magit-push. Only then it works because the minibuffer says "Git finished" and I can see the updated changes on Github web.
    – mle0312
    Commented Sep 6, 2021 at 23:21
  • The typical workflow is: (1) stage changes. (2) c c to begin the commit process and start editing a message. (3) C-c C-c to confirm the message and perform the commit. (4) P p or P u to push the commit to the remote.
    – phils
    Commented Sep 7, 2021 at 6:55
  • The main thing, though... after you 'committed' did the commit exist? Assuming you initiated the commit from the magit status buffer, it would have been refreshed after the commit and the new commit would be very obvious. You can always check with git log of course.
    – phils
    Commented Sep 7, 2021 at 7:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.