解壓源碼包git
tar xjvf git-1.8.3.tar.bz2
編譯xcode
cd git-1.8.3 ./configure --prefix=/usr/local make
安裝bash
sudo make install
第一步:成生SSH密鑰dom
打開終端,輸入ssh
ssh-keygen -t rsa -C "shiniv@shiniv.com"
輸出文字iphone
Generating public/private rsa key pair. Enter file in which to save the key (/Users/diaosi/.ssh/id_rsa):shiniv_test 在上方輸入生成的密鑰文件名,如shiniv_test,屏幕輸出: Enter passphrase (empty for no passphrase): 輸入密碼 Enter same passphrase again: 確認密碼 Your identification has been saved in diaosi. Your public key has been saved in diaosi.pub. The key fingerprint is: 25:fd:01:00:89:98:49:bf:2e:ac:32:2e:d2:5d:bf:98 shiniv@shiniv.com The key's randomart image is: +--[ RSA 2048]----+ | ..+ ..o... | | +.. . . . | | . . o . | | . o . . | | . S . | | . . . | | .o... . | |=.... o. | |*o E .. | +-----------------+
屏幕提示生成密鑰文件成功,保存在/Users/shiniv文件夾下。ide
第二步:把diaosi.pub中的內容加入git@osc 的SSH密鑰中
地址:http://git.oschina.net/keys/new工具
第三步:添加SSH並鏈接ui
輸入命令:ssh-add ~/.sshgoogle
Enter passphrase for /Users/shiniv/diaosi:輸入密碼
Identity added: /Users/shiniv/.ssh/ (/Users/shiniv/.ssh/)
輸入命令ssh -T git@git.oschina.net,屏幕輸出:
The authenticity of host 'git.oschina.net (58.215.179.44)' can't be established.
RSA key fingerprint is 14:b8:b8:0b:c2:b2:5e:ae:f2:21:f8:18:4d:3a:be:fc.
Are you sure you want to continue connecting (yes/no)? yes(輸入yes),屏幕輸出:
Warning: Permanently added 'git.oschina.net,58.215.179.44' (RSA) to the list of known hosts.
第四步:設置我的信息
輸入命令:
git config –global user.name 「shiniv」 git config –global user.email shiniv@shiniv.com
打開命令行工具,執行命令:
cd gitOSChina/JBCalendar/ 進入項目的目錄 git init 初始化本地庫(僅第一次時須要) git remote add origin git@git.oschina.net:shiniv/shiniv_test.git 添加遠程版本庫的別名
#排除build目錄 build/* # Exclude temp nibs and swap files # 排除nib臨時文件和交換文件 *~.nib *.swp # 排除OS X的文件夾顯示屬性目錄 .DS_Store # 排除xcode3 xcode4的用戶自定義設置文件 *.mode1 *.mode1v3 *.mode2v3 *.perspective *.perspectivev3 *.pbxuser xcuserdata
接着繼續提交
git add . 添加全部文件到版本庫 git commit -a -m "第一次提交數據" 添加全部修改該版本庫 git pull origin master 從遠程庫獲取併合併到本地庫 git push origin master 將修改推送到遠程庫
1. 相似於建立項目時的操做,打開命令行工具,執行命令
cd xcode/iphone/ 進入項目的目錄 git add . 添加全部文件到版本庫 git commit -a -m "這裏是要填寫的提交說明,必須" 添加全部修改該版本庫 git pull origin master 從遠程庫獲取併合併到本地庫 git push origin master 將修改推送到遠程庫
2. 至此,更新完畢。