Skip to content

Eihen/dotconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Linux Environment

Installing these files on your system

  • Add the repository folder to a .gitignore in your home folder to avoid recursion problems
echo '.dotconfig' >> $HOME/.gitignore
  • Clone this repository as bare into the .dotconfig folder
git clone --bare https://github.com/Eihen/dotconfig $HOME/.dotconfig
  • Define the alias in your current shell scope to make your life easier
alias config="/usr/bin/git --git-dir=$HOME/.dotconfig --work-tree=$HOME"
  • Set the local repository configuration to don't show untracked files (otherwise every file on your home folder will be showed)
config config --local status.showUntrackedFiles no
  • Checkout the actual repository content
config checkout
  • If one or more configuration files already exists the above command will fail with a message about those files being overwritten. To solve this you need to move the list files to a backup folder or just remove them if you don't care.

Set up your own .config repository

  • Init a bare repository on your $HOME folder
git init --bare $HOME/.dotconfig
  • Set an alias for the repository to make your life easier (it would be pretty painful writing the full command all the time)
alias config="/usr/bin/git --git-dir=$HOME/.dotconfig --work-tree=$HOME"
  • Set the local repository configuration to don't show untracked files (otherwise every file on your home folder will be showed)
config config --local status.showUntrackedFiles no
  • Put the alias we used before in your .bashrc for future use
echo "alias config='/usr/bin/git --git-dir=$HOME/.dotconfig --work-tree=$HOME'" >> $HOME/.bashrc

How to use it

  • You use it just like a git repository, replacing the git with the config alias

Examples

  • Display changed tracked files
config status
  • Add a new file or stage changes on already tracked files
config add .bashrc
  • Commit the changes to the repository
config commit
  • Push changes to upstream
config push

Credits

About

My linux environment configuration files

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages