美文网首页
git的简单使用

git的简单使用

作者: 泉泉泉泉泉泉 | 来源:发表于2018-06-07 14:03 被阅读0次

    git的使用

    1.查看远程分支 :git branch -a

    2.查看本地分支:git branch

    3.切换分支:git chechkout <BranchName>

    4.切换并创建分支:git checkout -b <BranchName>

    5.删除本地分会:git branch -D <BranchName>

    6.删除远程分支:git push origin --delete <BranchName>

    7.修改远程仓库地址的3种方法:

    git remote -v

    1.修改命令

    git remote set-url origin [url] (推荐使用)

    2.先删后加

    git remote rm origin

    git remote add origin [url]

    3.直接修改config文件

    8.fatal: refusing to merge unrelated histories 的问题解决:

    step1: git merge master --allow-unrelated-histories

    step2: git pull origin master --allow-unrelated-histories 

    相关文章

      网友评论

          本文标题:git的简单使用

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