Re: Source control on /etc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Le jeudi 23 février 2012 à 08:48 +0100, Alfredo Palhares a écrit :
> Hello Don, 

> You create a bare repo:
> $ mkdir etc.git
> $ git init --bare
> Now lets congigure it to chek the files elsewhere:
> $ git config core.worktree /etc
> And export these vars to you current session 
> $ export GIT_DIR=/path/to/etc.git
> $ export GIT_WORK_TREE=/etc

hi all,

"git config core.worktree /etc" is not really needed in your setup

I would like to suggest to use alias instead of env var. This way you
can work easily on multiple git repo in the same shell

for example
alias etc-git='git --git-dir=/path/to/etc.git --work-dir=/etc'
alias home-git='git --git-dir=/path/to/home.git --work-dir=$HOME' #just
check that $HOME is defined

and run
etc-git add /etc/pacman.conf
etc-git rc.conf
home-git add anyfileinhome
home-git commit -a
etc-git commit -a

place the aliases in your .bashrc or aliases file



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux