-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
## Configs | ||
|
||
My Linux configs. Included is cmg is a small script to manage symbolic links. | ||
Each config has a comment including the actual path to the file. For example | ||
bashrc contains: | ||
|
||
# [cmgr] .bashrc | ||
|
||
Several of the functions in my bashrc are sourced from this [thread][1] on the | ||
Arch Linux forums. In particular: | ||
|
||
- [tputcolors is by Gen2ly][2] | ||
- aur is based on [brisbin33's aurget][3] | ||
- cpf, mvf, goto by [drcouzelis and brisbin33][4] | ||
- cfg based on Peasantoid's Python [string manager][5] | ||
- [define is by gadamat][6] | ||
- yt is from [this YouTube video][7] | ||
|
||
[1]: http://bbs.archlinux.org/viewtopic.php?id=56646 | ||
[2]: http://bbs.archlinux.org/viewtopic.php?pid=658127#p658127 | ||
[3]: http://bbs.archlinux.org/viewtopic.php?pid=493337#p493337 | ||
[4]: http://bbs.archlinux.org/viewtopic.php?pid=697235#p697235 | ||
[5]: http://bbs.archlinux.org/viewtopic.php?id=89030 | ||
[6]: https://bbs.archlinux.org/viewtopic.php?pid=912445#p912445 | ||
[7]: http://www.youtube.com/watch?v=QCuq0_nY3Xk | ||
My Linux configs. | ||
|
||
Previously I was storing my configs in `~/configs` and using symlinks to link | ||
them into place. This worked though the whole symlink thing was a bit of a | ||
nuisance. It was an extra step that was required. Recently I came across a | ||
[better way][1] using a bare git repo. Configs are stored in `~/.cfg` as a bare | ||
git repo and are checked out directly into the home directory. This relies on a | ||
couple of things. | ||
|
||
First clone your configs as a bare repo: | ||
|
||
`git clone --bare <git-repo-url> $HOME/.cfg` | ||
|
||
Then define an alias: | ||
|
||
`config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'` | ||
|
||
This tells git to use `~/.cfg` as the repo and `~` as the working directory. | ||
Next tell git to ignore untracked files using the above alias: | ||
|
||
`config config --local status.showUntrackedFiles no` | ||
|
||
You can then interact with the git repo using `config` and standard git commands | ||
such as `config ls-files`, `config diff`, `config commit`, etc. | ||
|
||
See the link above for a full description of how this works. | ||
|
||
[1]: https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/ |