8 ms·
Git-repo – Manage Gitlab, GitHub and Bitbucket from the command line
- adamnemecek 10y agoI'm surprised Github et al. haven't tried to contribute some functionality for doing this to git. The thing described in the article is extremely common.
- azdavis 10y agoThey have, sort of. https://hub.github.com https://hub.github.com
- adamnemecek 10y agoDo you use it?
- cmrx64 10y agoI use hub whenever working with GitHub. It's quite nice, since the rewrite in Go.
- azdavis 10y agoNo, actually, but I did (sort of) reimplement[0] the "git browse" command that hub gives you. I'd probably use hub if I was involved in more projects that didn't have me as the sole developer. [0]: https://github.com/azdavis/dotfiles/blob/master/bin/git-browse https://github.com/azdavis/dotfiles/blob/master/bin/git-brow...
- guyzmo 10y agohehe, it's also implemented in git-repo: `git hub open`
- daddykotex 10y agoGoood, I'd really like to try it out. I'm tired of opening the browser go to my fork and create a branch to make a MR/PR for the project I'm working out. I will really try it out. Thanks!
- michaelmior 10y agoI use hub[0] to accomplish some of the same things. `hub fork` creates a fork and sets up a new remote. After pushing to my fork, `hub pull-request` creates a pull request. [0] https://github.com/github/hub https://github.com/github/hub
- azdavis 10y agoIMHO, hub works best if you alias git=hub in your shellrc.
- zerocrates 10y agoI don't use hub much, but I prefer not to alias it even though that's what they recommend as well. I think it's best to keep them separated so you know what stuff is coming from hub and what's in vanilla git instead. "git" is already synonymous enough with "GitHub" in many peoples' minds without including GitHub-specific functionality in your mental model of the command line client.
- azdavis 10y agoThat's definitely true.
- guyzmo 10y agoWell, I saw about hub, but I wasn't happy with the fact that it's a github only tool, I really wanted a service agnostic tool, and also because the CLI API was not great. I don't want a tool to replace git, I want it to extend it. What git-repo really offers is a tool that integrates nicely to the git CLI (as `git-something` is also available as `git something`, so git-repo acts per default as `git repo hub…`). And then it autoconfigures the .gitconfig aliases to have the `git hub`, `git lab`, `git moo` you'd want. So besides the fact that hub is certainly much more mature than my tool, it wouldn't be a tool I'd like to really use.
- michaelmior 10y agoYou can just alias hub to git to solve the first problem. As far as being service agnostic, that's a fair point. I rarely use anything outside of GitHub.
- awinter-py 10y agoCool but 'repo' is a really hard name to search. There's already a tool by this name and they have the same problem. https://code.google.com/p/git-repo/ https://code.google.com/p/git-repo/
- guyzmo 10y agoWell, first the name really is `git-repo` not `repo`, and as nobody has really heard of it yet, the pypi package is already on first page of go, and second page of google. I hope that if people like the tool, it's going to be easier to find. Of course, I'm not really obsessed with the name (as anyway the tool is designed so the user does not type git-repo everyday ). So if someone comes up with a name that's great that can be better, I'm all ears! About the fact that google has that other tool… Well they really are not much projects using it, beyond the google projects, and the tool really is called `repo`, not `git-repo`, so the name clash is not really there.
- awinter-py 10y agoI think harrow uses it for their builds
- t3f 10y agoThis a thousand times. I was initially confused this was a fork of Google's/Android repo (gag). https://code.google.com/p/git-repo https://code.google.com/p/git-repo https://source.android.com/source/using-repo.html https://source.android.com/source/using-repo.html
- awinter-py 10y agoI wish repo were the worst thing about building android
- KZeillmann 10y agoI really enjoy how the author broke down both the problem and the solution, explaining why the existing solutions are inadequate. I often see articles about new products or new programming languages, and their features, but they often forget to mention what problem prompted the solution. Why was a new language invented to solve this problem? Why were the existing solutions limiting? Bravo to the author here for making all that information clear and up-front.
- Aldo_MX 10y ago> I really enjoy how the author broke down both the problem and the solution, explaining why the existing solutions are inadequate. A thousand times this, I always get frustrated that every single product, tool or service has to have a lot of marketing gibberish, catchy slogans, etc., but zero explanations of what problems do they attempt to solve, or what was the motivation to create them. You usually are required to dig further in the documentation or look for an external reference to understand what's the real purpose behind a product, tool or service.
- guyzmo 10y agothank you a lot for your comments I actually wrote that tool based on a huge frustration I had going back and forth to the browser, and not being able to work while being agnostic to the services, which felt being a totally broken UX. I have then worked on that tool for a while, used it and refactored it a lot up until I'm happy using it. All in all, when I'm doing a tool, I'm first doing it for myself (I might invent the DIFY concept, to override the DIY concept )… only then I'm sharing it with others.
- mst 10y agoThe same situation kinda drove me insane too, but I've been happily using - https://github.com/ingydotnet/git-hub/ https://github.com/ingydotnet/git-hub/ for a while now. It might be interesting to compare and contrast your tooling and git-hub - ingy's being straight bash, while a little crazy, makes installation really trivial, but then again yours supports multiple services, but then again who knows whether the different subcommand syntaxes will work better or worse for any particular other user. (also, lest anybody think this is a veiled complaint, I'm sure ingy's reaction to finding your work exists will be "awesome, the more the merrier" followed by figuring out if you came up with any features he wants to steal ;)
- 0xmohit 10y agothen you watch the code, create a branch: git checkout -b `bugfix/nasty_one` Please remove backticks from the command. What if you called the branch `poweroff` instead and a naive reader copy/pasted the command into her terminal?
- icebraining 10y agopoweroff: Need to be root
- 0xmohit 10y agoOne might have sudo privileges configured via /etc/sudoers (It's the default on AWS EC2 instances!)
- icebraining 10y agoYes, but you still need to call "sudo poweroff", not just "poweroff".
- avhon1 10y agoSee user chainsaw10. Anecdotally, on my vanilla Arch systems, I can run "poweroff" without being root, and without sudo, and the computers will end all processes and turn off.
- chainsaw10 10y agoSome recent distros will actually let you run that as yourself, without root, if you're physically present at the machine. It's convenient for personal machines.
- guyzmo 10y agoThanks, fixed
- lucideer 10y agoThis is wonderful. I'd guess that this little tiny bit of extra friction is enough of a disturbance to the workflow for private local/personal/work projects to prevent many from bothering to contribute back in some cases (I'm definitely guilty here).
- guyzmo 10y agoAnd I hope also level the game for alternatives to github. Git is distributed by nature, and we should only be happy to see cross services forks happening!
- seschwar 10y agoThere's also git-spindle for this: - https://seveas.github.io/git-spindle/ https://seveas.github.io/git-spindle/ - https://github.com/seveas/git-spindle https://github.com/seveas/git-spindle
- guyzmo 10y agowhat the… ok I totally missed that one! And I DID search before writing such a tool
- StavrosK 10y agoThat's what always happens to me as well. I've attributed it to me only half-heartedly searching, because deep down I just want to write the tool.
- guyzmo 10y agoWell, TBH, as an engineer, I hate to reinvent the wheel. I prefer to join and improve the existing concept with my own ideas to make it the synthesis of many peoples ideas You might see on my github that I do that a lot, I'm being some sort of mercenary of FLOSS projects, as I patch wherever I see a bug or want a new feature without really caring about the "big plan" Actually, I wrote the tool because deep down I just want to /use/ the tool.
- mballantyne 10y agoSpindle already has some of the things on your TODO list, but seems only semi-maintained. It'd be awesome if you two could join forces!
- mst 10y agoNow I have an urge to write git-fold and git-mutilate.
- prh8 10y agoI really like that this works for all services interchangeably. Yes, Github created Hub for this same problem, but I've used Bitbucket at some jobs and Gitlab personally for some projects. Having something uniform and service agnostic is great. It's clear the creator thought a lot about this design feature.
- Omnipresent 10y agoFeature request - Add the ability to create a merge request from command line. Esp for GitLab
- guyzmo 10y agoSee the issues, it's already implemented, but not released yet. The issue is that I also am working on the gitlab snippets… which lacks an API. So I'm currently working on a patch to add an API to the gitlab snippets, so my tool can have gitlab snippets! https://github.com/guyzmo/git-repo/commit/59c7ac2cd4c0316016bf8a03c2fbedbc19fe5626 https://github.com/guyzmo/git-repo/commit/59c7ac2cd4c0316016... So pretty soon I hope I'll be able to finish both MR and snippets for gitlab, and finish the tests and merge all that back to git-repo!
- tommieb 10y agoWhat about bitbucket? I see references to lab and hub, is bitbucket missing?
- ihuman 10y agoIt looks like there is currently partial bitbucket support according to the TODO and HN title
- guyzmo 10y agoBitbucket support is there. But it's not feature complete, and not up to my standards… The issue I have is that I got to implement OAuth2 for bitbucket, because the privatekey scheme offered by bitbucket does not work for a CLI tool use case. So currently, the credentials (login/password) of bitbucket are stored in CLEAR in the configuration file, which really, really sucks… And some new features (like the snippets) are not implemented in third part python libraries, because most of the libs are old and unmaintained. Anyway, following some discussions I had with atlassian bitbucket developers, bitbucket (like gitlab) is planning to switch to swagger, which will help automagical generation of client-side feature complete libraries. So I'm planning to level bitbucket feature set as soon as they land the new API. So I hope it won't be long before all the features will land for the three services!
- zymhan 10y agoThe site is now returning an error. I guess HN killed it?
- guyzmo 10y agonah, I don't think so, I think you might have reloaded as I was recompiling the blog
- StavrosK 10y ago> The git utility has a rather well designed interface to make it easy to remember, extend, and/or customize > (which nobody does, because who remembers the git remote syntax? I wish we would move on from the "git has good UX" narrative, it's preventing us from actually improving the UX.
- guyzmo 10y agonote that I did not say that git has a good UX, I said it's /rather well designed/… Maybe should I have emphazised on the /rather/, or used something stronger like /relatively/ . But anyway, designing the command line API of my own tool took me enough headaches — and I'm still not 100% satisfied — to understand how hard it is to have a consistent and great UX for something that offer as many features as git does. Though, I'm trying my best to avoid the decade old troll about git's UX (like vs mercurial)… In the end, what I try to make clear it's that I'm not trying to replace what git does, but cluster a bunch of repository actions tied with some service's API operations. And I try my best to offer a pleasant UX doing so. But please, help me making it better!
- StavrosK 10y agoI agree with you on everything, except the "easy to remember" part. Git's UI is very convoluted and inconsistent. Designing a good UI is really hard, but I see too many people fall into the "I learnt it, so it must be easy!" trap. Congratulations for making git-repo, by the way! It looks extremely useful.
- guyzmo 10y agoWell, for the easy to remember, I might have been presomptuous O:-)
- gbraad 10y agoThe name is slightly problematic as Google also released something with the same name: used for Android to solve the issue with multiple repositories instead of submodules. Besides that, looks interesting and I will give it a try!
- guyzmo 10y agoWell as I said for another post I'm aware of that. As the google project is mostly used only for android and chromium, and as the canonical name of the tool really is /repo/ and not /git-repo/, there's no real name clashing. The only issue might be my project being shadowed by google and go, but the more people will like and use the tool I baked with , the more it'll appear on their first page. So it's not really up to me, but up to you all liking it! And finally, if someone comes with a nicer better name than what I chose (I actually did not spend more than 2.42 minutes on the name when I had to mkdir the project's directory), I might be happy to rename :) Otherwise, I hope you'll like the tool and send me patches and <3
- syngrog66 10y agonice idea. bad name
- erikb 10y agoHonestly, I just opened the post to find ridiculous things to criticise. But in fact this looks like a valid helper. Sure I don't have the same workflow, but this one seems to work as well. Good work!
- ponytech 10y agoI am using a private gitlab instance. No support for this?
- guyzmo 10y agoYes there is! There's a bug that has been found that crashes the feature, but I got a patch ready to publish.
- pferde 10y agoI'm amazed that nobody has commented yet about how this is a CLI wrapper around web services which are wrappers around a CLI tool. Or is everyone here already too jaded and so used to piling endless abstractions upon abstractions that this is considered normal? How about if people simply accepted patches via e-mail, instead of requiring those obnoxious github pull requests?