https://github.com/arnested/git-templates
My Git template folder
https://github.com/arnested/git-templates
Last synced: 11 months ago
JSON representation
My Git template folder
- Host: GitHub
- URL: https://github.com/arnested/git-templates
- Owner: arnested
- Created: 2012-12-28T17:13:18.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2013-04-02T20:12:51.000Z (almost 13 years ago)
- Last Synced: 2025-04-10T00:56:00.359Z (11 months ago)
- Language: Perl
- Homepage:
- Size: 125 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.pod
Awesome Lists containing this project
README
=head1 My Git templates
This is my Git templates.
I currently just have a post-checkout hook that is run after each
clone. The rest of it is just the "standard" template.
Put it somewhere (i.e. in C<~/.gitconfig.d/git-templates>) and setup
your git to use it:
git config --global --replace-all init.templatedir ~/.gitconfig.d/git-templates
=head1 Dependencies
I had to install JSON.pm and Config::IniFiles.pm:
sudo cpan -i JSON
sudo cpan -i Config::IniFiles
The rest of the dependencies was already installed.
=head1 The actual hooks
=head2 post-checkout
Doesn't do anything if it is a not run as a clone operation.
If git is checking out a specific revision (at least when C does it) the C<.git/logs/refs> folder is not created and then
you won't be able to run C. So let us just make sure the
folder is always there.
Gets the remote URL and does stuff based on where we are cloning from.
=head3 Drupal.org repositories.
Configure C and C.
They will be set to the value of C and
C if they exist.
Also set the description of the checkout (C<.git/description>) to the
description found in the C<.info> file.
git config --global --replace-all user.drupal.name arnested
git config --global --replace-all user.drupal.email arnested@245635.no-reply.drupal.org
=head3 GitHub repositories.
Use the GitHub API to look up if this repository is a fork of
another repository and if so set the original repository as
"upstream" branch.
Configure C and C based on the GitHub organization.
They will be set to the value of C and
C if they exist.
Also set the description of the checkout (C<.git/description>) to the
description of the GitHub repository.
Getting data through the GitHub API is currently only supported for
public repos.
git config --global --replace-all user.reload.email arne@reload.dk
Add remote origins for fetching pull requests, see
https://gist.github.com/piscisaureus/3342247.