Created
February 7, 2015 08:34
-
-
Save gmgp/8ae6812fe78475c6e96a to your computer and use it in GitHub Desktop.
two git in the same folder one for code one for configuration
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
# only folder b1 under configuration | |
# all others files are program files | |
# | |
# create and use a alias bash gitconf | |
mkdir PROG | |
echo content >> PROG/readme | |
mkdir PROG/FOLDER_A | |
echo content >> PROG/FOLDER_A/filea-1 | |
echo content >> PROG/FOLDER_A/filea-2 | |
mkdir PROG/FOLDER_B | |
mkdir PROG/FOLDER_B/FOLDER_B1 | |
echo content >> PROG/FOLDER_B/FOLDER_B1/conf_fileb1-1 | |
mkdir PROG/FOLDER_B/FOLDER_B2 | |
echo content >> PROG/FOLDER_B/FOLDER_B2/fileb2-1 | |
cd PROG | |
git init | |
cat >.git/info/exclude << EOL | |
/* | |
!/FOLDER_B | |
/FOLDER_B/* | |
!/FOLDER_B/FOLDER_B1 | |
EOL | |
git add . | |
# only add | |
# conf_fileb1-1 | |
git commit -m "first commit" | |
mv .git .gitconf | |
echo .git >> .gitconf/info/exclude | |
git init | |
echo .gitconf >> .git/info/exclude | |
echo /FOLDER_B/FOLDER_B1 >> .git/info/exclude | |
git add . | |
git status | |
# all files without FOLDER_B1 | |
alias gitconf='git --git-dir=.gitconf' | |
gitconf status | |
# git --git-dir=.gitconf status | |
# | |
# nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment