I am using the git-emacs to submit code to github throug Emacs.
It is ok for add
and commit
, but it seems that git-emacs do not support the git push
operation. When I type M-x git-push
, it responds with "no such command".
-
You can run `git push` in `eshell`. – ceving Aug 25 '14 at 14:33
5 Answers
-
1so i turn to magit , but i still fail to push , it is ok to stage and commit , but when i type P P to do a git push , it just said: "git push -v ...... " in the console , it did not really push anything into the repository, could you help with this also? – zolibra Dec 07 '12 at 06:01
-
There is a problem with github: https://github.com/magit/magit/pull/433 Check by pressing `$` whether Magit hangs on login. Update to newest Magit, and if this doesn't help -- well pushing is just a couple of keystrokes in the shell... – lukstafi Mar 18 '13 at 23:02
Newer versions of Emacs provide the command:
C-x v P
longer version:
M-x vc-push
(as noted by @CAT0). If your version of Emacs doesn't support that command, try:
M-& git push [Enter]
longer version:
M-x async-shell-command [Enter] git push [Enter]
As pointed out by @mariotomo this is better than the synchronous version below because it opens a buffer for the output.
M-! git push [Enter]
longer version:
M-x shell-command [Enter] git push [Enter]
(M-
is short for "Meta key" which can be Esc
or Alt
or Ctrl+[
).
(and if you're on Windows and hesitate to use the shell which goes to a nasty DOS shell by default, try running Emacs as emacs-w32
from Cygwin, things will be saner).

- 2,240
- 29
- 23
-
1even better, use `M-&` so emacs won't be stuck waiting for git to complete, and a buffer will appear with the output of the command. – mariotomo Jul 29 '17 at 21:40
In emacs 25 (maybe also earlier) there is the command
vc-push
which does exactly what it should. It is bound to C-x v P

- 31
- 1
This is an unfortunate side effect of the fact the built-in Emacs VCS support(vc-mode
) is mostly built for tools like cvs, subversion, etc that have a totally different workflow. DVCS support was added fairly soon (in Emacs 23). I hope vc-mode
will be improved in the near future. Until then...
As @khagler said Magit supports git push
. Another solid option for you to explore is Egg.

- 55,802
- 13
- 100
- 117
By git-emacs, you can push in the following way:
M-x git-cmd
, which is bound toC-x g .
( Ingit-status
window it is bound to.
)- type in
push

- 143
- 6