1#! /usr/bin/env perl 2# ABSTRACT: A tool to make it easier to manage multiple code repositories using different VCSen 3# PODNAME: got 4 5 6use 5.014; # strict, unicode_strings 7use warnings; 8 9use App::GitGot; 10App::GitGot->run; 11 12__END__ 13 14=pod 15 16=encoding UTF-8 17 18=head1 NAME 19 20got - A tool to make it easier to manage multiple code repositories using different VCSen 21 22=head1 VERSION 23 24version 1.339 25 26=head1 SYNOPSIS 27 28 cd some/proj/in/a/vcs 29 30 got add 31 # answer prompts for various information 32 # or run with '-D' to take all defaults 33 34 # show managed repositories 35 got list 36 got ls 37 38 # run a command in selected repositories 39 got do --tag perl --command "ls t/" 40 41 # show managed repositories sorted by path (default = sort by name) 42 got ls -p 43 44 # remove repo #1 from the list 45 got remove 1 46 47 # remove repo named 'bar' from the list 48 got remove bar 49 50 # remove all repos tagged 'foo' without confirmation prompts 51 got rm -f -t foo 52 53 # remove repo #3 without confirmation prompts and be noisy about it 54 got rm -f -v 3 55 56 # show status (up-to-date, dirty, etc.) for all repos 57 got status 58 59 # show status for repo #3 60 got st 3 61 62 # fetch upstream for all repositories 63 got fetch 64 65 # fetch upstream for repo #3 66 got fetch 3 67 68 # update all repos with configured remotes 69 got update 70 71 # update repo named 'bar' 72 got up bar 73 74 # Note: if a repo is in the list but doesn't have a local checkout, 'got 75 # update' will create directories as needed and do the initial check out. 76 77 # Run the 'git gc' command to garbage collect in git repos 78 got gc 79 80 # spawn a subshell with working directory set to 'path' of repo #1 81 got chdir 1 82 83 # spawn a subshell with working directory set to 'path' of repo foo 84 got cd foo 85 86 # or use 'tmux' subcommand to open a new tmux window instead 87 got tmux 1 88 got tmux foo 89 # N.b., 'tmux' will reuse an existing window if one is open 90 91 # checkout a local working copy of a repo and add it to your list of repos. 92 # will prompt for info on what to name repo, tags, etc. 93 got clone <git/http/ssh url> 94 95 # As above, but accept defaults for all options without prompting 96 got clone -D <git/http/ssh url> 97 98 # fork a github repo, add it to your list of repos, and check it out in 99 # the current working directory 100 got fork https://github.com/somebodies/repo_name 101 102 # note: the default path to a repo added via 'fork' is a directory 103 # named 'repo_name' in the current working directory 104 105 # if you just want to fork without checking out a working copy: 106 got fork --noclone https://github.com/somebodies/repo_name 107 108 # finally, please note that you need a C<~/.github-identity> file set up 109 # with your access token or your username and password in the following key-value 110 # format: 111 user username 112 pass password 113 114 # *OR* 115 access_token token 116 117 # note that if you specify both, the access_token value will be used 118 119 # show version of got 120 got version 121 122=head1 DESCRIPTION 123 124C<got> is a script to make it easier to manage all the version controlled 125repositories you have on all the computers you use. It can operate on all, 126some, or just one repo at a time, to both check the status of the repo (up to 127date, pending changes, dirty, etc.) and sync it with any upstream remote. 128 129got also supports forking a GitHub repo and adding it to the list of managed 130repositories. 131 132=head1 OPTIONS 133 134In addition to the subcommand-specific options illustrated in the SYNOPSIS, 135all the subcommands accept the following options: 136 137=over 4 138 139=item * C<--verbose / -v> 140 141Be more verbose about what is happening behind the scenes 142 143=item * C<--quiet / -q> 144 145Be more quiet 146 147=item * C<--tags / -t> 148 149Select all repositories that have the given tag. May be given multiple 150times. Multiple args are (effectively) 'and'-ed together. 151 152=item * C<--skip-tags / -T> 153 154Skip all repositories that have the given tag. May be given multiple 155times. Multiple args are (effectively) 'or'-ed together. May be combined with 156-t to select all repos with the -t tag except for those with the -T tag. 157 158=item * C<--no-color / -C> 159 160Suppress colored output 161 162=item * C<--color-scheme / -c> 163 164Specify a color scheme. Defaults to 'dark'. People using light backgrounds may 165want to specify "-c light". 166 167The name given to the option indicates a library to load. By default this 168library is assumed to be in the 'App::GitGot::Outputter::' namespace; the 169given scheme name will be appended to that namespace. You can load something 170from a different namespace by prefacing a '+'. (E.g., '-C +GitGot::pink' will 171attempt to load 'GitGot::pink'.) 172 173If the requested module can't be loaded, the command will exit. 174 175See COLOR SCHEMES for details on how to write your own custom color scheme. 176 177=item * repo name, repo number, range 178 179Commands may be limited to a subset of repositories by giving a combination of 180additional arguments, consisting of either repository names, repository 181numbers (as reported by the 'C<list>' subcommand), or number ranges (e.g., C<2-4> 182will operate on repository numbers 2, 3, and 4). 183 184Note that if you have a repository whose name is an integer number, bad things 185are going probably going to happen. Don't do that. 186 187=back 188 189=head1 COLOR SCHEMES 190 191Color scheme libraries should extend C<App::GitGot::Outputter> and need to 192define four required attributes: C<color_error>, C<color_warning>, 193C<color_major_change>, and C<color_minor_change>. Each attribute should be a 194read-only of type 'Str' with a default value that corresponds to a valid 195C<Term::ANSIColor> color string. 196 197=head1 SEE ALSO/CREDITS 198 199=over 200 201=item L<http://github.com/ingydotnet/app-aycabtu-pm/> 202 203Seeing Ingy döt Net speak about AYCABTU at PPW2010 was a major factor in the 204development of this script -- earlier (unreleased) versions did not have any way 205to limit operations to a subset of managed repositories; they also didn't deal 206well managing output. After lifting his interface (virtually wholesale) I 207ended up with something that I thought was worth releasing. 208 209=item L<http://www.leancrew.com/all-this/2010/12/batch-comparison-of-git-repositories/> 210 211drdrang prodded me about making the color configuration more friendly to those 212that weren't dark backrgound terminal people. The colors in 213C<App::GitGot::Outputter::light> are based on a couple of patches that drdrang 214sent me. 215 216=item L<The Wire|http://en.wikipedia.org/wiki/The_Wire> 217 218=back 219 220=head2 Similar tools 221 222=over 223 224=item L<Git::Bunch> 225 226Allows to check the status and exec commands on a list of 227repository, as well as to sync the local machine's repositories with 228another via rsync. Can also manage (and rsync) regular directories. 229 230=item L<myrepos|http://myrepos.branchable.com/> 231 232Allows to run the main commands (C<update>,C<status>,etc) in all registered 233repos. Advertised as working with many versioning systems. 234Not on CPAN nor GitHub. 235 236=back 237 238=head1 LIMITATIONS 239 240Currently git is the only supported VCS. 241 242=head1 CONTRIBUTORS 243 244=over 245 246=item Yanick Champoux <yanick@babyl.dyndns.org> 247 248=item Michael Greb <michael@thegrebs.com> 249 250=item Chris Prather <chris@prather.org> 251 252=item Rolando Pereira 253 254=item Tina Müller <tinita@cpan.org> 255 256=item Karen Etheridge 257 258=item Lucy Wyman 259 260=back 261 262=head1 AUTHOR 263 264John SJ Anderson <john@genehack.org> 265 266=head1 COPYRIGHT AND LICENSE 267 268This software is copyright (c) 2020 by John SJ Anderson. 269 270This is free software; you can redistribute it and/or modify it under 271the same terms as the Perl 5 programming language system itself. 272 273=cut 274