0

Can you actually create local branch that tracks a remote branch Intellij? As you can see here, the master branch tracks the origin/master But the MOT-*** branches, doesn't

I was able to create a tracked branch using git commands, but I wonder if it is possible to do this on IntelliJ (I'm using the 2022.3.3 version)

  • 1
    Does this answer your question? [Track a new remote branch created on GitHub](https://stackoverflow.com/questions/11262703/track-a-new-remote-branch-created-on-github) – dan1st Jun 04 '23 at 08:01
  • Thank you for your comment, but what I'm trying to do is to create a branch directly from Intellij IDE without any git commands – Guilherme Rodriguero Jun 06 '23 at 23:24
  • Does https://stackoverflow.com/q/37154113 or maybe https://stackoverflow.com/q/68625668 help you? (the other comment here was created due to automatic graduation/publishing with a pending duplicate vote). – dan1st Jun 06 '23 at 23:30

1 Answers1

0

Assuming origin/MOT* branches do not exist already on remote, you can simply push all these branches after making sure that remote is configured in your git remotes.

If they do already exist on remote, then you can still checkout. You will get a complaint from Intellij saying MOT* local branch already exists with same name. Here you can select to overwrite current branch with checkout of the remote. Just ensure you do not have any commits that you'd like to keep in the currently existing local branches that are not available on the remote branches. You may stash those and then add to the new local MOT* branches later.

Troubleshoot tip: Sometimes the overwrite button will be disabled. tweaking the branch name (and restoring it) will enable the overwrite button for some reason

dmbhatti
  • 314
  • 2
  • 11