git 基本使用

1.创建新分支

git branch <分支名>

2.提交你的修改

git status          查看文件状态

git diff            查看修改的文件详细内容

git add .           添加当前修改的文件到暂存区

git commit –m "你的注释"    提交你的并加上注释

git pull origin <分支名>   拉远程代码,个人习惯性加上分支

git push origin <分支名>   推送代码到远程分支

3.分支合并

git merge <branch> # 将branch分支合并到当前分支

git merge origin/master --no-ff # 不要Fast-Foward合并,这样可以生成merge提交

4.打tag

git tag  查看所有tag

git tag -a <tag名称> -m "tag注释"

git push origin --tags  推送tag到远程服务器

git tag -d <tag名称>   删除本地tag


5.删除远程分支

git branch -r -d origin/branch-name
git push origin :branch-name

6.其它

git clone <远程地址>

更多的请参考:http://blog.csdn.net/waterforest_pang/article/details/9762863

http://justcoding.iteye.com/blog/1830388


【声明】 

欢迎转载,但请保留文章原始出处

博客地址:http://www.cnblogs.com/lping/

文章来源:http://www.cnblogs.com/lping/p/5470670.html

 

原文地址:https://www.cnblogs.com/lping/p/5470670.html