zoukankan      html  css  js  c++  java
  • git branch & checkout fetch 的使用和冲突解决

    git branch & checkout fetch 的使用和冲突解决

    branch

    git branch    查看本地分支

    git branch -v     查看本地分支的具体信息(commit id,例如:f65ded9 和 commit 信息)

    git branch -r   查看远程分支

    git branch -a     查看本地和远程分支

    git branch -vv         查看本地分支和远程分支的对应关系

     

    git branch <new-branch-name>          新建本地分支

    git branch <new-branch-name> <commit id>     给 commit id 新建一个分支

    git branch -d <branch-name> [<branch-name>]     删除(多个)本地分支

    git branch -m <new-anem>            在当前分支中修改当前分支的名字

    checkout & branch

    git checkout <branch-name>  切换到另外的一个分支

    fetch & branch

    git fetch origin master:<name-branch-name>  抓取远程仓库 origin 的 master 分支到本地的一个新分支<name-branch-name>

    git diff <branch-name>             查看分支<branch-name>和当前分支的差异

    git merge <branch-name>          融合分支<branch-name>到当前分支

    merger冲突

    如果当前分支和 merge 的分支有冲突(修改了同一个文件),而且当前分支没有 commit 过,就会提示先 commit,再 merge,这时候 merge 会提示那些冲突的文件自动合并失败,并让我们手动修复后在 commit 一次,在冲突的文件中会有类似以下内容:

    <<<<<<< HEAD:index.html
    <div id="footer">contact : email.support@github.com</div>
    =======
    <div id="footer">
    please contact us at support@github.com
    </div>
    >>>>>>> iss53:index.html

    修改后:

    git add -A

    git commit -m 'fix confliction'

    git push

  • 相关阅读:
    webstorm
    web大文件上传(web应用---SSH框架)
    Webuploader 大文件分片上传
    百度Webuploader 大文件分片上传(.net接收)
    java使用WebUploader做大文件的分块和断点续传
    大文件上传插件webupload插件
    使用Webuploader大文件分片传输
    使用原生Java Web来实现大文件的上传
    Java实现浏览器端大文件分片上传
    怎样使用word2013发布csdn博客
  • 原文地址:https://www.cnblogs.com/ibingshan/p/10374101.html
Copyright © 2011-2022 走看看