Code Monkey home page Code Monkey logo

git-local's Introduction

git-local

Git-local uses a separate bare Git repository to track files that the main repository should not track. Especially useful for versioning configuration files. Most git commands are just passed through, and a few are special:

  • git local init
  • git local status
  • git local add

Example

Inside a git repository,

$ git status --short
?? src/config/local.yml

create an overlapping, but purely local repository,

$ git local init
Initialized empty Git repository in /home/me/project/.git-local/
$ git local status --short
## Tracked and modified files:

## Untracked files that upstream ignores or does not track:
src/config/local.yml

where you can add files, commit, and use any git command:

$ git local add src/config/local.yml
$ git local commit -m "local config"
[master (root-commit) 81aeaf5] 1
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 other
$ git local log --format=oneline
81aeaf5dd5b86fce443cc06cbb6e237aa7432241 local config

The default behavior for the locally tracked files is to ignore them in the main repository. Here, the YAML file was added to the main .gitignore:

$ git status
?? .gitignore

$ git local status -v
## Tracked files:
src/config/local.yml
 
## Tracked and modified files:
nothing to commit (use -u to show untracked files)

## Untracked files that upstream ignores or does not track:
.gitignore

Commands

init

Initialize a local repository in .git-local, next to .git.

--no-gitignore : Do not create/update the .gitignore file to hide the local repository.

status

With no option, lists files locally commited, or ignored upstream, or untracked upstream. To set a list of patterns to ignore, modify .git-local/info/exclude.

--verbose -v : Display also the tracked and unchanged files.

add

The files tracked by the upstream repository will be ignored.

--no-gitignore : Do not add lines in the upstream .gitignore about the files tracked bu git-local.

git-local's People

Watchers

François Gannaz avatar James Cloos 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.