Tôi nghĩ là ý tưởng tốt hơn để tải lên một kho lưu trữ. Hãy để tôi nói cho bạn biết tôi đã làm như thế nào.
Tôi phiên bản toàn bộ ~/binthư mục. Của tôi .bash_profilelà trên thư mục đó. Đây $HOME/.bash_profilelà một liên kết đến ~/bin/.bash_profile.
Tôi .bash_profiletrông như thế này:
if [[ $OSTYPE == darwin* ]]; then
. ~/bin/includes/exports-osx.sh
. ~/bin/includes/bash-stuff-osx.sh
. ~/bin/includes/aliases-osx.sh
. ~/bin/includes/functions-osx.sh
elif [[ $OSTYPE == linux* ]]; then
. ~/bin/includes/exports-linux.sh
. ~/bin/includes/terminal-linux.sh
. ~/bin/includes/aliases-linux.sh
. ~/bin/includes/ssh-keys-linux.sh
. ~/bin/includes/bash-stuff-linux.sh
fi
. ~/bin/includes/bash-stuff.sh
. ~/bin/includes/aliases.sh
. ~/bin/includes/powerline.sh
. ~/bin/includes/functions.sh
. ~/bin/includes/work-stuff.sh
Bằng cách đó tôi có thể dễ dàng theo dõi các thay đổi.
Để giữ cập nhật repo, bạn có thể tạo tập lệnh cron hoặc LaunchAgents để kéo các thay đổi trên ~/binthư mục của bạn mỗi ngày một lần:
cd ~/bin && git pull origin $(git name-rev --name-only HEAD)