create git space
git init
set the local cofig
git config --global user.name "xx"
git config --global user.email "xx@hotmail.com"
set the remote url
git remote add origin https://git.oschina.net/xx/aaa.git
download file:
git fetch
create the local branch to link to the remote branch:
git checkout -b master origin/master
add new file:
git add fileName
git commit ……
git push……
modify the loacl file and reupload:
git diff
git commit -a -m"decription"
git push origin master
download file :
git fetch origin
git merge origin/master
check the modified log
git log -p
create a new branch:
git branch testing
switch to branch:
git checkout testing
create and switch to a new branch:
git checkout -b testing
merge the branch:
git checkout master
git merge testing
delete a merged branch:
git branch -d testing
list all the branches:
git branch -v
list all the unmerged branches:
git branch --no-merged
roll back commit:
git reset --hard commit_id
暂时先整理了如上,希望对大家有帮助!
参考的学习资料也给小伙伴分享下:
http://git.oschina.net/progit/