Git clean branch and Merge Conflicts

To deal with merge conflicts, it’s best to use a good UI tool. I recommend using the intellij, you can visually see that difference and also able to track down who made the changes if there’s any questions.

if you don’t care about losing you changes you can use the command line to force merge into your branch “git merge -X thiers”. Useful when you are sharing input files. 

When working with large monolithic repo, branches of features and spin offs are often forgotten and left hanging in the codebase. there grow larger when merging is completed, but not cleaned. in just after 2 week, inactive branches are behind by 1000+ commits. some branches older than 90 days are out of sync by 10k commits.

for innovation, i made a sh script tool to help analyze the outdated branches and also possible to implement the delete remote branch function to clean it up.

The basic setup for the code script:

  1. pull the branch names and date of last updates from “git show-branch -all”
  2. parse the output into array or list, then for each of them pull out any system generated, backups.
  3. ask for input or parameters  in the command line to filter by. days  cutoff.
  4. ask for input or confirm deleting those list of branches.
  5. generate emails of output files of the changes made.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s