【代码托管】git基本命令

git的基本使用

拉取并merge代码

git pull 

添加暂存区

get add .

提交到本地仓库并加上注释

get commit -m ''

往远程仓库推送代码

git push origin master

多人协作方式

  • 分支的构建
  1. 查看所有的分支
git branch -a
  1. 创建新的分支
git checkout -b aaa
  1. 切换到aaa分支
git checkout aaa
  1. 推送aaa分支到远程仓库aaa分支
git push origin aaa
  1. 本地添加一个远程仓库
git remote add origin https://github.com/xxx/xxx.git
  1. 将本地的master和远程添加的master进行连接
git push origin master:master同之前
  1. 克隆到本地
git clone xxx(地址)
  1. 拉取远程的文件(另一个人写了传了,你想搞下来)
git pull origin master
  1. 推送master到远程的aaa分支
git push origin master:aaa
  1. 删除一个分支
git branch -d xxx

猜你喜欢

转载自blog.csdn.net/ICe_sea753/article/details/101147325