美文网首页
Git 常用命令

Git 常用命令

作者: 梅子plum | 来源:发表于2020-03-05 02:40 被阅读0次

1.链接远程仓库


$ git remote add origin 仓库地址

// 链接远程仓库

$ git clone 仓库地址

//克隆远程仓库

$ git clone -b dev 远程仓库

// 克隆指定分支

$ git remote rm 远程仓库名称

//删除连接的远程仓库

2.获取远程代码


$ git pull origin master

// 强制 pull

$ git pull origin master --allow-unrelated-histories

3.push代码


//初次提交,需要配置用户信息

$ git config --global user.name "name"

$ git config --global user.email "email"

$ git status 查看装填

$ git add 文件路径

// 提交全部

$ git add .

$ git commit -m "本次提交说明"

$ git push origin master

4.附Git常用命令速查表

image

相关文章

网友评论

      本文标题:Git 常用命令

      本文链接:https://www.haomeiwen.com/subject/dqnnlhtx.html