emacs - 你如何刷新Magit中的 Remote ?

标签 emacs github magit

Magit 真的很好,但我还没有弄清楚如何从它创建一个远程分支,或者如何刷新它知道的远程分支而不删除远程并重新添加它。
目前我去github,添加一个分支,然后进入magit,删除远程,然后再添加回来。有没有更好的办法?

最佳答案

应该使用 git fetch 来刷新远程分支。 .

Magit (documentation) :

Typing f f will run git fetch.
It will prompt for the name of the remote to update if there is no default one.

Typing f o will always prompt for the remote.

Typing F F will run git pull.
When you don’t have a default branch configured to be pulled into the current one, you will be asked for it.



Rémi commented , f a 将获取所有 Remote 。

实际上,如 akaihola comments 2018年:

If you type F, you get the "pull" menu.
Then:

  • p pulls from the push default (see b M-p), and
  • e from elsewhere (e.g. another remote branch).


创建远程分支应该是将本地分支推送到远程:

Magit will run git push when you type P P.
If you give a prefix argument to P P, you will be prompted for the repository to push to.
When no default remote repository has been configured yet for the current branch, you will be prompted as well.

Typing P P will only push the current branch to the remote.
In other words, it will run git push <remote> <branch>.

The branch will be created in the remote if it doesn’t exist already.
The local branch will be configured so that it pulls from the new remote branch.

If you give a double prefix argument to P P, you will be prompted in addition for the target branch to push to.
In other words, it will run git push <remote> <branch>:<target>.

关于emacs - 你如何刷新Magit中的 Remote ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24216353/

相关文章:

emacs - Emacs 中每种模式的不同颜色主题

c++ - 在 c++ 模式下更改 emacs 上 'case' 关键字中的选项卡计数

emacs - 如何将 <C-left> 发送到 Emacs 术语中?

Github:将不同的项目消息路由到我帐户上的不同电子邮件

docker - Magit无法连接到docker内的emacsclient?

Emacs + magit - 垂直责备

git - magit-grep,如何包含或排除文件扩展名?

linux - 是否有用于检查 ELF 文件的任何 emacs 模式

带有空子模块文件夹的 GitHub zip 下载

node.js - 如何识别授予授权权限的用户?