![]() The "checking" that Git does is different from the checking that git remote does, so do not be too surprised if they do not agree. Use git branch -d branchname to delete-with-checking, and git branch -D branchname to delete forcefully, i.e., without checking. ![]() The trick is knowing when it is safe to delete, although "when I'm not already using it and won't be using it" is always a good enough time. If you're not using a local branch name, though, you can simply delete it as a distraction. The full answer is a bit complex, in part because git remote does something no other Git command can do. TL DR: you probably just want to delete some of your branches Here we go, technically all in one line: git remote show origin | grep "local out of date" | awk '' | xargs -n 1 git branch -d Ideally I was looking for a command to delete all local out of date branches in one line, but I guess I'll just have to make a short script for it. ![]() Yes, thank you torek, your immediate answer is correct, all I wanted to do was delete the local branch. I thought git pull -all would be the solution, but that doesn't do anything for me.ĮDIT: Wow I'm an idiot, I was way overthinking it. All my searches just turn up with people wanting to delete the remote branches or prune branches that no longer exist on remote. ![]() I am not sure why I'm having such a difficult time figuring this one out. I don't care about these branches, all I want is to not have local out of date versions, either by getting them up to date or removing my local copy (while retaining the tracking of origin/branchName). When I run a git remote show origin I have a bunch of local out of date branches. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |