用到的 git 命令

1.创建分支

  git branch branch_name

2.删除分支

  1).删除本地分支

  git branch -D branch_name

  2).删除远程分支

  git push orgin :branch_name

3.切换分支

  git checkout branch_name

4.将本地分支分布到服务端

  git push orgin branch_name

5. 把本地代码推送到远程仓库

  1). 先进行本地仓库初始化 git init

  2). 提交代码到本地仓库  git commit .

  3). 添加远程仓库地址 git remote (alais name) (remoteUrl) eg:git remote remote_rep https://git.oschina.net/xxx.git

  4). 推送数据到远程仓库 git push -u (alais name) (branch name)

    eg: git push -u remote_rep master

    Ps:默认新仓库分支名称是master,一般都是会重复 请使用其他名字; -u 必须添加 

 

posted @ 2015-07-30 14:06  xue780599725  阅读(133)  评论(0)    收藏  举报