-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"--prune" option for "git sync" #2557
Comments
Note. For my usage, I still want to be able to prune branches without syncing all my branches (changelog mentioned potentially deleting that command) |
Charlie!! 🎉 Please note the updated terminology for "prune" that this ticket proposes. The old This ticket proposes a new meaning for There were some requests to bring the old |
The downside with the current to me is that in order to prune branches I need to sync all my other feature branches. I often use prune-branches more as a cleanup than anything and don't want to deal with syncing other branches at the time. My preference would be running git sync on any branch also prunes branches. And thus anytime I get auto-cleanup vs needing to use a dedicated command to cleanup things |
Thanks for the helpful feedback 🙏
Can you please outline why syncing feature branches is a chore to you that you want to postpone at times in your situation? Does it incur extra effort beyond updating the branch (like running a lengthy
WDYT? |
In both of the above cases and the general, the main issue is I don't think its worth my time to deal with merge conflicts if they exist as the branches aren't important at the moment. Hypothetically I could mark those I want to skip as perennial or have some new status that allows me to sync them with master but be excluded from sync all. However, I generally am focusing my time on one branch at a time and just use prune branches to auto cleanup my local to make it easier to find the branch I care about.
Nice, that will avoid me accidentally re pushing a branch that should be deleted
Hmm, think there are cases I won't like this as sometimes use the UI to rebase changes to pickup a fix in the master branch (vs doing local sync and then reset in order to maintain as one commit). Based on your arguments I think I'd prefer to keep a prune-branches command or something like |
Thanks for the detailed feedback! Your use cases are pretty representative for how staff-level engineers work. Git Town should support such use cases fully without requiring workarounds. I have brainstormed support for three additional branch types in #3095 that address all the needs you describe. The goal is that even people like you who have broader responsibilities can run
This would be addressed by making this branch an "observer branch". You can check out a branch as an observer branch by running
This would be addressed by making these branches "parked branches".
There could be an
Note that you can now set the sync-feature-strategy to Would you find these features useful in your work? PS: Until the new branch types are implemented, here is a Bash snippet that deletes all branches with deleted remotes (I haven't tested this so proceed with caution): LC_ALL=C git branch -vva | grep 'gone]' | awk '{ print $1 }' | xargs git br -D |
@charlierudolph Git Town 12.1 implements new branch types that support the use cases you outlined above: https://www.git-town.com/advanced-syncing
Run
Run To unpark a parked branch you run Notice the ability to change branch types in bulk by running Curious what you think! |
git sync --prune
syncs the current branch and removes it if it is emptygit sync --all --prune
syncs all branches and removes those that are emptygit sync
andgit sync --all
can be run without thinking and only do safe deletes.git sync --prune
deletes more branches, including ones that are empty without having been shipped, at the risk of deleting branches that weren't obsolete, for example empty branches that the user just created in order to do something with them.For ergonomics an
-ap
switch that enables--all
and--prune
should work.To implement this, the behavior of how branches get synced needs to be slightly adjusted:
The text was updated successfully, but these errors were encountered: