Score:2

How can I find dirty git repositories across filesystem on Ubuntu 20.04? (with not commited or not pushed changes)

cn flag

Is there any tool that would

  • scan my filesystem
  • list git repositories where some changes are not committed
  • list git repositories where some changes are not pushed to origin (or currently active remote) and local repository is ahead
  • be usable on Ubuntu 20.04

?

(it should not be subjective as criteria listed here are objective)

N0rbert avatar
zw flag
You can try do some scripting starting with `find ~ -name .git -type d -execdir git status {} +` .
reducing activity avatar
cn flag
@N0rbert I know that I can write it on my own (though I would rather build it in Python, easier to debug) but I really hope that there is an existing tool for that.
reducing activity avatar
cn flag
To people voting close: can you let me know why you are doing this? I thought that it would be obviously applying to software on Ubuntu but I now specified it explicitly
mike mcleod avatar
cn flag
Try SmartGit. Its free for own use. Available [here](https://www.syntevo.com/smartgit/) It will scan and show you your git projects and you can see graphically the state etc, of each project.
reducing activity avatar
cn flag
@mike Their [licensing](https://www.syntevo.com/smartgit/purchase/) is weird "SmartGit can be used free of charge by Open Source developers, teachers and their students, or for hobby, non-paid usage." - OK, that describes all my projects. And they title it "Non-Commercial Licenses" what makes it confusing. OK, maybe it is intended as "Non-Commercial" for them? Plenty of teachers and developers of open source (including me) are paid for at least part of work. But on starting the program I have no option covering this case, only "solely for non-commercial purposes"
reducing activity avatar
cn flag
@mikemcleod Note that if this works then you can submit it as an answer ("solely for non-commercial purposes" would not be true for me and I have not decided yet whether I prefer to pay or create own script). Note that bounty expires soon.
mike mcleod avatar
cn flag
There are a number of 'free' Git GUI's [here](https://git-scm.com/downloads/guis). I looked at Vershd and it will do what you want, in fact the first step after the intro is to perform a search for repositories.
Luuk avatar
cn flag
you wrote: "@N0rbert I know that I can write it on my own (though I would rather build it in Python, easier to debug)" What did make you not do do so ?
reducing activity avatar
cn flag
@Luuk From bounty description: "I really hope that there is existing tool that I can use (and maybe contribute back if needed) rather than cobble together yet another fragile script." I have already several fragile, failing/failed scripts, many relying on something deprecated or not fully working. I really prefer to avoid reinventing the wheel if possible.
Luuk avatar
cn flag
It really does not matter how you use `git`, you can do it directly from the command-line as N0rbert showed, or you can use PHP, (see: https://gist.github.com/dbu/2843660 ) or you can change that to something in Python.
reducing activity avatar
cn flag
@Luuk This command will only list status of all git repositories, right? I am interested in listing only ones where there is something to be pushed.
Luuk avatar
cn flag
You always can change `git --status` to something else to get the needed info. It's up to you to specify which info you need.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.