git2r icon indicating copy to clipboard operation
git2r copied to clipboard

Utility function

Open ThierryO opened this issue 5 years ago • 2 comments

Would you accept a PR which adds a function that brings a local repo inline with the remote? It checks all local branches and does the following:

  1. remove local branches if they are fully merged into origin/master
  2. display the name of the branch if it is behind its counterpart at origin
  3. remove the local branch if it diverged from origin after asking twice for user consent

ThierryO avatar Jun 30 '20 06:06 ThierryO

In the near future, I would like to prioritize work on improving the credentials functionality over adding new features. Therefore, I feel a little hesitant to add and maintain that utility function. What is the use case?

stewid avatar Jul 02 '20 15:07 stewid

For the time being I wrote a new_branch() function and added it our checklist package.

I noticed that novice git users keep a lot of obsolete branches (fully merged with the main branch on GiHub) on their machine because they don't know how to get ride of them. They often start a new branch from an outdated main branch or from a non-main branch.

If you are interested, I'm happy to send a PR that creates new_branch(), clean_git() and is_workdir_clearn(). I'm willing to maintain them too.

ThierryO avatar Sep 08 '21 13:09 ThierryO