码迷,mamicode.com
首页 > 其他好文 > 详细

常用git命令分享

时间:2015-02-25 15:40:27      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:git

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



暂时先整理了如上,希望对大家有帮助!

常用git命令分享

标签:git

原文地址:http://blog.csdn.net/howardge/article/details/43937327

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!