0

I am using a triangle workflow. Upstream is called upstream and my forked repository is called fork.

I want to have multiple branches and each of those branches should exist both locally as well as in my forked remote repository. My plan is to synchronize from my fork into a local feature branch, work on it some, and push it to the corresponding branch on my forked repository again.

When I create the branches in fork (using Github's UI), I can't seem to get my local repository to pull that new branch.

I've tried pulling from fork as well as upstream, but neither works. I can only think I'm doing something stupid - anyone care to tell me what?

  • When you look at the status buffer (the one that shows up after you run magit-status), at the top, it should say what branch is tracked by the currently active branch (it calls it "Merge"). You can change the tracked branch by starting a push operation and then choosing e (elsewhere) option. – wvxvw Oct 18 '16 at 7:53
  • Does my answer address this question sufficiently? – tarsius Nov 2 '16 at 20:10
1

Cloning a repository does only create a single local branch. Usually that branch is named master and its upstream is origin/master. To create an additional branch some-feature from an existing remote branch my-fork/some-feature, you could use b c my-fork/some-feature RET RET.

The upstream of that branch would be my-fork/some-feature, but since you mentioned that you want to use a triangular work-flow, you probably want to use either master or origin/master as upstream. You can change the upstream using b u. You can also configure Magit to always adjust the upstream when creating a new local branch from a remote feature branch by customizing magit-branch-adjust-remote-upstream-alist.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.