美文网首页工作生活
如何建立新的分支并提交代码

如何建立新的分支并提交代码

作者: sagfugetabf | 来源:发表于2019-07-02 15:56 被阅读0次

时间:2019年7月2日15:56:13


  1. 新建分支
    git branch 分支名字
    这个是第一次建立分支之后,用到的push语句
    git push --set-upstream origin 分支名字

  2. 切换分支
    git checkout 分支名字

  3. 选中当下目录的全部文件
    git add .

  4. 提交代码
    git commit -m "add new code"
    git push

  5. 没有设置git 邮箱和用户名的话
    git config --global user.email "you@example.com"
    git config --global user.name "Your Name"

相关文章

网友评论

    本文标题:如何建立新的分支并提交代码

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