Have a merge workflow which deletes the branch right there.
I found a useful Git one liner buried in leaked CIA developer docs
191–200 of 273 posts
Re: I found a useful Git one liner buried in leaked CIA developer docs
#192Re: I found a useful Git one liner buried in leaked CIA developer docs
#193Here's my take on the one-liner that I use via a `git tidy` alias[1]. A few points: * It ensures the default branch is not deleted (main, master) * It does not touch the current branch * It does not touch the branch in a different worktree[2] * It also works with non-merge repos by deleting the local branches that are gone on the remote git branch --merged "$(git config init.defaultBranch)" \ | grep -Fv "$(git config…
Re: I found a useful Git one liner buried in leaked CIA developer docs
#194Using grep and xargs is worth a whole blog post now? hmmmmm
hey, gemini, how do I...
Re: I found a useful Git one liner buried in leaked CIA developer docs
#195Re: I found a useful Git one liner buried in leaked CIA developer docs
#196So effectively "I just discovered xargs"? Not to disparage OP but there isn't anything particularly novel here.
Re: I found a useful Git one liner buried in leaked CIA developer docs
#197Here's my take on the one-liner that I use via a `git tidy` alias[1]. A few points: * It ensures the default branch is not deleted (main, master) * It does not touch the current branch * It does not touch the branch in a different worktree[2] * It also works with non-merge repos by deleting the local branches that are gone on the remote git branch --merged "$(git config init.defaultBranch)" \ | grep -Fv "$(git config…
The use of init.defaultBranch here is really problematic, because different repositories may use a different name for their default, and this is a global (your home directory scope) setting you have to pre-set. I have an alias I use called git default which works like this: default = !git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@' then it becomes ..."$(git default)"... This figures out th…
Re: I found a useful Git one liner buried in leaked CIA developer docs
#198Here's my take on the one-liner that I use via a `git tidy` alias[1]. A few points: * It ensures the default branch is not deleted (main, master) * It does not touch the current branch * It does not touch the branch in a different worktree[2] * It also works with non-merge repos by deleting the local branches that are gone on the remote git branch --merged "$(git config init.defaultBranch)" \ | grep -Fv "$(git config…
The use of init.defaultBranch here is really problematic, because different repositories may use a different name for their default, and this is a global (your home directory scope) setting you have to pre-set. I have an alias I use called git default which works like this: default = !git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@' then it becomes ..."$(git default)"... This figures out th…
I work at a company that was born and grew during the master->main transition. As a result, we have a 50/50 split of main and master.
No matter what you think about the reason for the transition, any reasonable person must admit that this was a stupid, user hostile, and needlessly complexifying change.
I am a trainer at my company. I literally teach git. And: I have no words.
Every time I decide to NOT explain to a new engineer why it's that way and say, "just learn that some are master, newer ones are main, there's no way to be sure" a little piece of me dies inside.
Re: I found a useful Git one liner buried in leaked CIA developer docs
#199Earlier quoted context omitted.
This feels like gatekeeping someone sharing something cool they've recently learned. I personally lean more towards the "let's share cool little productivity tips and tricks with one another" instead of the "in order to share this you have to meet [entirely arbitrary line of novelty/cleverness/originality]." But each to their own I suppose. I wonder how you learned about using xargs? Maybe a blog-post or article not…
I don't think there's anything wrong with sharing something cool, even if it's trivial to other people. The problem is framing a blog post with "ooh this was buried in the secret leaked CIA material".. and then the reader opens it to find out it's just xargs. It feels very clickbaity. Akin to "here's one simple trick to gain a treasure trove of information about all the secret processes running on your system!!" and…
Re: I found a useful Git one liner buried in leaked CIA developer docs
#200If something this natural requires several lines of bash, something is just not right. Maybe branches should go sorted by default, either chronologically or topologically? git's LoC budget is 20x LevelDBs or 30% of PostgreSQL or 3 SQLites. It must be able to do these things out of the box, isn't it? https://replicated.wiki/blog/partII.html