This tool stores files in a git repository and creates links instead automatically. Files are kept in the same structure as they were before but can be categorized for easy accessibility.
using ltg
A typical folder will look a bit like this:
$ ls -ARl ~/.ltg .ltg/: total 84K drwxr-xr-x 2 user users 4.0K Jun 4 20:04 general drwxr-xr-x 2 user users 4.0K Jun 4 20:04 vim drwxr-xr-x 8 user users 4.0K Jun 5 21:53 .git -rw-r--r-- 1 user users 43 Jun 4 20:06 .gitmodule .ltg/general total 12K drwxr-xr-x 2 user users 4.0K Jun 4 13:11 .gitconfig drwxr-xr-x 3 user users 4.0K Jun 4 13:22 .i3 -rw-r--r-- 1 user users 3.9K Jun 4 12:14 .bash_prompt -rw-r--r-- 1 user users 5.6K Jun 5 01:26 .bashrc .ltg/vim total 4.0K drwxr-xr-x 3 user users 4.0K Jun 4 13:22 .vim ...
Getting there is really simple. To add a new file, call store:
$ ltg store ~/.xinitrc ~/.Xdefaults ~/.bashrc $ ltg store --category vim ~/.vim
it will now be added to your dotfile folder (by default ~/.ltg), a git repository should be set up and the files have been added to the index.
To link the files or recreate lost links you can use link:
$ ltg link -f
ltg will then automatically create links to all stored files instead of the original.
To automatically store and link files, use add:
$ ltg add -c vim .vim
To update changed files run:
$ ltg git -- add ~/dotfiles/bash/.bashrc
or simply:
$ ltg git -- add -A
The git command forwards commands directly to git (with baked in directories), meaning you can run:
$ ltg git -- remote add origin git@bitbucket.com:user/dotfiles.git ... $ ltg git -- pull --recurse-submodules origin master ... $ ltg link $ ltg add -c bash ~/.bashrc $ ltg git -- push ...
There is a handy command group available to simplify pulling and pushing, sync:
$ ltg sync down $ ltg sync up
will first pull remote changes (via rebase) and then push local changes in a single commit.
TODO
unlinking
removing
atomatic commit messages
simplify git integration
Metadata
Release files for ltg 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ltg-0.2.5.tar.gz | 9.7 kB | Details |
Release files / ltg-0.2.5.tar.gz
| Download URL | ltg-0.2.5.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8af555d24456e42ca373009cf20e376afe015f211e6dd93ffcf63cfdfd31ea7e
|
|
BLAKE2b-256 checksum How to use checksums |
49904b170f3c409f63057cb56367699286e0c901b5c5ebe8387686b1c8ca4ad2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |