zolibra
zolibra

Reputation: 532

How to git push using git-emacs?

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".

Upvotes: 13

Views: 4885

Answers (5)

Kai Carver
Kai Carver

Reputation: 2298

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).

Upvotes: 7

CAT0
CAT0

Reputation: 31

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

Upvotes: 3

Chromatic
Chromatic

Reputation: 153

By git-emacs, you can push in the following way:

  1. M-x git-cmd, which is bound to C-x g . ( In git-status window it is bound to .)
  2. type in push

Upvotes: 1

Bozhidar Batsov
Bozhidar Batsov

Reputation: 56665

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.

Upvotes: 1

khagler
khagler

Reputation: 4056

You're right, it doesn't. However, magit can push.

Upvotes: 7

Related Questions