Karl Zeilhofer
Karl Zeilhofer

Reputation: 460

How to use multiple remotes with GitKraken

I'm using GitKraken quite frequently, but I cannot manage how to set to which remote I want to push. In the context menu I cannot find any entry like "use this remote for push/pull".

I have to set it via the command line, then it works as expected.

git push -u origin2 dev/mybranch

is this really a missing feature?

Upvotes: 21

Views: 7603

Answers (3)

jjz
jjz

Reputation: 976

You can also drag and drop to push to a different remote:

Drag and drop to push

Source: https://help.gitkraken.com/gitkraken-client/pushing-and-pulling/#drag-and-drop-to-push

Upvotes: 3

Mihir Joshi
Mihir Joshi

Reputation: 450

  1. Right-Click on the local branch from which you want to pull, click on Set Upstream. Set Upstream

  2. Select the origin that you want to push, click submit. Select Origin

Now, pushing (clicking on the Push button) will push to the selected origin! And when you want to change the origin the next time, repeat the step-1 and push.

Upvotes: 8

daveaie
daveaie

Reputation: 354

I'm currently trying to configure correctly more than one remote repo.

I understood that you have already setup correctly your remotes (by click plus simbole near REMOTE). Now :

  • if you fetch (pull) some branches from remotes: the default are automatically set to remote you chose/click in REMOTE section.
  • if you create a new branch: when you push first time, at the top of gitkraken window appear confirmation message. There you can chose which remote to push. Your chose will set as default for that branch.
  • if you want to change remote of a branch already in use: right click on desired brach in LOCAL section, in the menu you can find "set ", in my case "set upstream". So appear at the top of gitkraken window the confirmation message to setup the default remote for that branch.

You can check the result in the .git/config file in the home dir of your project.

Edit: Ok, I've tested this solution for some day. It's running structurally and I confirm this solution. Evenif when you switch from one branch with some remote to an other brach with different remote, some times the ui not responding correctly (freez or stop refreshing). So a I need to close and reopen gitkraken.

Upvotes: 18

Related Questions