Search code examples
gitgitlabgitk

Master branch has extra information about merged branches


The project which I am developing has not neat commit information.

  • The project repository is on Gitlab
  • For merging, fast-forward merge is chosen (without extra merge commit) and source branches are deleted after merging into master

But when running git log --pretty=oneline I get this output, where some commits have the additional information from which branch the commit was merged: (origin/issue_48)... (origin/issue_35)... (origin/issue_41

73b6c2cdd531e897b75a4b87072a9ac475920ded Add changelog and versioning guideline
32a5527f3104569e8f98a2b31883e0113b3c8915 (origin/issue_48) Add changelog
05c878f1cb559175bfdc6c330e07332773ec94e9 (origin/issue_35) Add datetime commandin command line
29c30969a7b60d3c996b2a4fa0f06adc41649948 (origin/issue_41) Match function name to its functionality

The same when opening in gitk looks like this:

enter image description here

To me the desired output is: 73b6c2cdd531e897b75a4b87072a9ac475920ded Add changelog and versioning guideline without any extra information about source branches.

Is it possible to remove this extra info also from old commits? The repository is mine. I can unprotect the master branch and forcibly update it until it is not too late.


Solution

  • What you're seeing here are remote tracking branches. Usually, when you push a branch to a remote or fetch from a remote, remote tracking branches are created on your system that correspond to what's on the remote. This helps you provide an easy way to keep track of what the remote has and refer to those branches if you need to.

    There's no reason to worry about this and this information is local only to your copy of the repository (and not the server side), but if the branches have been deleted from the remote and you no longer want to have the corresponding remote tracking branches, you can run git fetch --prune origin and they'll be deleted.