How do you upgrade remotes in Magit?

Magit is really nice, but I still have to figure out how to create a remote branch from it, or how to update the remote branches that it knows without removing the remote and adding it back. Currently I go to github, add a branch, then go to magit, remove the remote, and then add it back. Is there a better way?

+7
github emacs magit
source share
1 answer

Updating the remote branch should be done using git fetch .

With Magit (documentation) :

Input f f will be done by git fetch .
He will suggest updating the name of the remote control if it is not installed by default.

Entering f o will always request the remote.

Entering f f will start git pull .
If you do not have a default branch configured to pull into the current one, you will be asked about this.

As Rémi commented , f a will eject all remotes.


Creating a remote branch should be pushing the local branch to the remote:

Magit will start git push when entering P P.
If you give the prefix argument P P , you will be prompted to click on the repository.
If a non-remote default repository has not yet been configured for the current branch, you will also be asked to specify it.

Entering P P will only push the current branch to the remote computer. In other words, it will work git push <remote> <branch> .

A branch will be created on the remote computer if it does not already exist .
The local branch will be configured to be retrieved from the new remote branch.

If you give the double prefix argument P P , you will be asked to additionally specify the target branch to go to. In other words, it will work git push <remote> <branch>:<target> .

+11
source share

All Articles