Created
August 21, 2011 07:59
-
-
Save sragu/1160309 to your computer and use it in GitHub Desktop.
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
mkdir -p ~/Dropbox/git-repo/dotfiles.git | |
cd ~/Dropbox/git-repo/dotfiles.git | |
git init --bare |
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
cd ~/projects | |
projects $ git clone ~/Dropbox/git-repo/dotfiles.git | |
Cloning into dotfiles... | |
done. | |
projects $ cd dotfiles/ | |
dotfiles(master) $ |
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
dotfiles (master) $ cp -pr ~/.ssh . | |
dotfiles (master) $ git ci -am" initial commit" |
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
#name: deploy.sh | |
# move the dot files to home | |
#!/bin/sh | |
git ls-files | grep "^\\." | xargs -n1 -I{} cp -prfv {} ~/{} | |
#name: update.sh | |
#move the updated dot files back to the local repository | |
#!/bin/sh | |
git ls-files | grep "^\\." | xargs -n1 -I{} cp -prfv ~/{} {} |
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
git clone ~/Dropbox/git-repo/dot-files.git | |
#copy the local dotfiles to repo. | |
./update.sh | |
#stash them if you want to bring them back | |
git stash | |
#deploy the repo dot files to home directory. | |
./deploy.sh | |
#alternative approach. | |
#copy to the repo | |
./update.sh | |
# diff the change to understand what your are adding or taking away from existing dot files | |
git diff | |
#once you have reviewed the changes and ready to go. | |
git branch -b <machine-name> master | |
git ci -am"merged changes" | |
#deploy the new branch to home directory | |
#Don't forget to push your changes to remote after any changes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment