這幾天在學習使用Git版本管理工具,發現期間的各種配置還是挺繁瑣的,而且好多命令的確記不住,於是寫個blog記錄下來,方便以后查閱。
1. 首先到GitHub官網上下載最新的Git,然后裝上,裝的過程就不具體說啦,都是簡單的玩意兒。
2. 接下來就是開始配置Git了,請注意看了,肉戲來了:
首先,准備三個必要的文件:
git-completion.bash
git-prompt.sh
bash_profile_coures.txt
下載鏈接:http://pan.baidu.com/s/1geJN2q3
下載完三個文件夾后,打開Git Bash,在命令行中輸入 “cd ~”,切換到主目錄。
然后依次輸入 “mv 文件路徑/git-completion.bash git-completion.bash”
“mv 文件路徑/git-prompt.sh git-prompt.sh”
“mv 文件路徑/bash_profile_coures.txt .bash_profile”
輸入完成后,重啟Git Bash,就可以看到效果了。
接下來是配置Git Bash默認文件編輯器。我這里選用的是sublime_text
同樣,打開Git Bash,然后輸入:
git config --global core.editor "'安裝路徑/sublime_text.exe' -n -w"
git config --global push.default upstream
git config --global merge.conflictstyle diff3
然后重啟Git Bash,整個配置就大功告成啦!