9

I've been working on a Mac using Sourcetree to manage my repositories. I've recently found an Ubuntu machine to develop on, and having found that Sourcetree isn't available for Ubuntu, found Gitkraken as a potential alternative.

My question is, is there any way to set a different remote repository in Gitkraken for pushes and pulls? (E.g. push to origin/develop pull from upstream/develop using the buttons on the top menubar). And if that isn't possible, is there a way to track a different remote branch from the one you are pushing/pulling from?

For example Sourcetree is set up so that local/develop tracks the remote branch upstream/develop, while pushing to the remote branch origin/develop. So if people make changes to the original repository, it'll show up in my Sourcetree and I'll know to pull from upstream/develop to local/develop. And if I make any changes, I can push my fork at origin/develop and create a pull request there to merge to upstream/develop if the changes are approved.

Also, in in Gitkraken if I right click upstream/develop there is an option to merge upstream/develop into develop that should take the most recent changes in upstream/develop and merge it into my local copy right? (God help me if suddenly I'm merging my local develop to upstream).

shstyoo
  • 183
  • 2
  • 10
  • +1 for this feature, I sent them email asking for this. Its very useful especially working with forking flow on OS projects. – To Kra May 09 '18 at 12:31

2 Answers2

9

I don't know how recently it is possible, but in version 6.0.0 of GitKraken, you can right-click on an origin and change push and pull paths independently.

screenshot

Matthew
  • 153
  • 1
  • 7
3

My question is, is there any way to set a different remote repository in Gitkraken for pushes and pulls?

There is no such feature AFAIK. When right-clicking a branch, you can select to Set Upstream. This results in the message What remote/branch should "<branch>" push to an pull from?, which implies that a branch can only be set to push and pull from the same upstream via GitKraken.

[...] is there a way to track a different remote branch from the one you are pushing/pulling from?

I do not understand what you mean by "track" here, since a branch tracking an upstream means it is using it to pull from and/or push to. As per definition here in section Tracking Branches, upstream and tracking branch are used synonymous, so I guess the answer is no:

[...]what is called a “tracking branch” (or sometimes an “upstream branch”).

Concerning your last question, you can calm down:

[...]if I right click upstream/develop there is an option to merge upstream/develop into develop that should take the most recent changes in upstream/develop and merge it into my local copy right?

That's exactly what it does, just like a git merge upstream/develop when you have checked out your local develop.

kowsky
  • 12,647
  • 2
  • 28
  • 41
  • Thanks for the response! Kinda sucks that there isn't a way to have a branch tracking different push/pull locations, but its nice getting some clarification on what the merge upstream/develop into develop does. I guess if I ever want to track the changes made to upstream I'll just have to manually set upstream every single time. – shstyoo Apr 26 '17 at 14:28
  • 2
    Also a workaround I guess is that you can have your develop branch track upstream, but have any other feature branches tracking origin which in essence does what I want it to. – shstyoo Apr 27 '17 at 15:09