Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to git push using git-emacs?

Tags:

git

emacs

lisp

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

like image 741
zolibra Avatar asked Dec 06 '12 02:12

zolibra


People also ask

What is Git push in Git?

git push. The git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repo.

How to push changes to remote repository in Git?

To push the project/changes into the remote repository, we need to have the remote repository’s location/URL. You can get the remote repository URL from above Clone or download dropdown button. Add your remote repository by hitting git remote add origin remote address. For the very first time, it may ask your git credentials to connect with it.

How do I force push a commit in Git?

git push --force origin main The above example assumes it is being executed on an existing repository with a commit history. git commit --amend is used to update the previous commit. The amended commit is then force pushed using the --force option. Deleting a remote branch or tag

Does Git push update the master branch?

By default, git push only updates the corresponding branch on the remote. So, if you are checked out to the master branch when you execute git push, then only the master branch will be updated. It's always a good idea to use git status to see what branch you are on before pushing to the remote.


2 Answers

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

like image 140
CAT0 Avatar answered Sep 30 '22 01:09

CAT0


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
like image 40
Chromatic Avatar answered Sep 30 '22 00:09

Chromatic