Coder Social home page Coder Social logo

git-config's Introduction

git-config

This is my git config. You should use it. You have more cool tricks? Open a PR :)

Install

git clone https://github.com/romgrk/git-config
cd git-config

# for the gitconfig
git config --global include.path $(pwd)/config

# for the ignore file
git config --global core.excludesfile $(pwd)/ignore

# for the pre-commit hook
git config --global core.hooksPath $(pwd)/hooks

# for the pager
# see https://github.com/so-fancy/diff-so-fancy

aliases

All aliases are included by including the config.

git fpr: fetch-pull-request

Run git fpr 28 and it retrieves the PR #28 as the branch pr-28.

[alias]
    fpr = "!sh -c 'nr=\"$1\" ; shift ; git fetch upstream refs/pull/$nr/head:pr-$nr \"$@\"' -"

Credits: someone other than me created this but I don't remember who :/ I think I found it on an issue in the neovim repo.

pre-commit hook

This hook prevents the commit from completing if some restricted keywords are present in the commit text. The default keywords are XXX and PREVENT_COMMIT. You can also define your own keywords by setting the env var GIT_PREVENT_COMMIT to a comma-separated list of restricted keywords.

This is useful if you are in the flow and touching many different files. If you add some development code that shouldn't end up in your repository, simply add one of the keywords and you'll be sure to be notified if you try to commit it by error.

demo

git-config's People

Contributors

romgrk avatar

Stargazers

Said Akkas avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.