解壓源碼包node
tar xjvf git-1.8.3.tar.bz2
編譯git
cd git-1.8.3 ./configure --prefix=/usr/local make
安裝dom
sudo make install
請參見老左的博客Xcode鏈接git@osc中第一步至第四步。ssh
打開命令行工具,執行命令:ide
cd gitOSChina/JBCalendar/ 進入項目的目錄 git init 初始化本地庫(僅第一次時須要) git remote add origin git@git.oschina.net:JustBen/jbcalendar.git 添加遠程版本庫的別名 git add . 添加全部文件到版本庫 git commit -a -m "commit JBCalendar" 添加全部修改該版本庫 git pull origin master 從遠程庫獲取併合併到本地庫 git push origin master 將修改推送到遠程庫
相似於建立項目時的操做,打開命令行工具,執行命令工具
cd gitOSChina/JBCalendar/ 進入項目的目錄 git add . 添加全部文件到版本庫 git commit -a -m "commit JBCalendar" 添加全部修改該版本庫 git pull origin master 從遠程庫獲取併合併到本地庫 git push origin master 將修改推送到遠程庫
1. 錯誤:google
git pull origin master ssh: Could not resolve hostname git.oschina.net:JustBen: nodename nor servname provided, or not known fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
解決方法:spa
從新設置SSH cd cd ~/.ssh/ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/Users/yongbin/.ssh/id_rsa): /Users/yongbin/.ssh/id_rsa already exists. Overwrite (y/n)? y Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /Users/yongbin/.ssh/id_rsa. Your public key has been saved in /Users/yongbin/.ssh/id_rsa.pub. The key fingerprint is: f8:87:a4:25:37:7c:bf:64:b1:4f:d5:e1:27:74:18:9e yongbin@YongbinZhang.local The key's randomart image is: +--[ RSA 2048]----+ | . | | . + | | E..| | o ...o| | o S . . ..+| | B + . o o.| | . o . = . | | . o + | | . . | +-----------------+ cat id_rsa.pub | pbcopy 在git.oschina.net中添加一個SSH,直接複製到裏面便可 cd ~/OSChina/JBCalendar/ 進入工程目錄 git add . git commit -a -m "xxxxxxxxxxxxxx" git pull origin master git push origin master