1

Question about GIT regarding intellij idea. I have a local branch develop and I perform a git fetch via GUI. I see develop gets a blue arrow meaning that there are some remote changes that happened. In the past I would just click on that branch and click update, but I noticed that sometimes fetched commits from remote get applied to my branch in a weird way, for example they get merged. Later when I want to make an MR I get duplicate commits because git doesnt recognize that my branch has these changes already.

Right now I just delete that develop branch and check it out again, to make sure I'm working on a proper develop.

Wondering if there is a better way of doing this instead of deleting develop branch and checking it out again each time?

Comments
  • 0
    Just checking out on the remote branch works for me, no need to delete the local branch
  • 1
    Have you tried fetching/pulling via cli?
  • 0
    A coworker of mine has some weird problems with it, too. For example if he does a rebase it's not rolling back his commits, pull the current state of the base branch, and reapplies his commits on top. It's mixing his commits with commits that were pulled based on the time they were created instead.
    I didn't find why yet and he more than once fucked his branch up by this.
  • 0
    Multiple thing possible here...

    1) the lurker

    Someone who has never looked at his configuration. Git changes. An 5 year old configurations by some shady program just filling in every possible configuration option in a git config file can be .... unpleasant entertainment. Make sure the git config is sane

    2) the hoarder

    I've seen devs using a wild clusterfuck of different tools. From using command line in version 1 to using that GUI tool with version 2 to using that other GUI tool with version 3 kind of clusterfuck. Make sure only one git version, best would be one with at least on patch version, is installed. Especially get rid of embedded git stuff in GUIs....

    3) Fuck up on server side

    E.g. the server git version is hopelessly outdated.

    The server allows force pushes or rewriting history, thus it's raining conflicts.
  • 0
    Use the CLI. It's faster and helps build the understanding to fix issues like this on your own.
Add Comment