zoukankan      html  css  js  c++  java
  • git工具使用

    让Log日志简短
    git log --pretty=oneline
    回滚之前的commit
    git reset --hard 1094a

     删除本地分支 

    命令行 : $ git branch -d <BranchName>

    删除远程分支 

    命令行 : $ git push origin --delete <BranchName> 

    git fetch:相当于是从远程获取最新版本到本地,不会自动合并。

    git pull:相当于是从远程获取最新版本并merge到本地

    clone远端分支到本地

    git clone -b v-liach/SelfServeModelBuild https://carinahome.visualstudio.com/DefaultCollection/Carina/_git/Carina.SelfServe

    git branch --set-upstream-to=origin/v-liach/selfserve wxldev1

    Branch 'wxldev1' set up to track remote branch 'v-liach/selfserve' from 'origin'.

    git pull origin master

    git merge origin/wxl

    然后vs中显示<<<<=====  ======>>>>>>>

    然后再git add . git commit -m 

    然后再push,然后就好了

    这个解决方案各采纳了两个分支中的一部分内容,而且删除了 <<<<<<<,=======,和>>>>>>> 这些行。在解决了所有文件里的所有冲突后,运行 git add 将把它们标记为已解决(resolved)。因为一旦暂存,就表示冲突已经解决。如果你想用一个有图形界面的工具来解决这些问题,不妨运行 git mergetool,它会调用一个可视化的合并工具并引导你解决所有冲突:

    git还原到之前某个版本,本地和远程都还原

    命令行操作:

    第一步: git log 查看之前的commit的id,找到想要还原的版本
    第二步: git reset --hard 44bd896bb726be3d3815f1f25d738a9cd402a477   还原到之前的某个版本
    第三步: git push -f origin master  强制push到远程

  • 相关阅读:
    Flutter -- iOS导航栏TabBar
    微信小程序布局
    Tomcat for Mac 搭建本地后台服务器 -- 探索Apache Tomcat
    masnory 动态高度
    iPhone 尺度 x xs sr xsmax
    Deepin 安装 tomcat
    Deepin 设置静态 ip
    md 文件 转 pdf
    mac 上关于截图的偏好设置
    MySQL笔记---DDL
  • 原文地址:https://www.cnblogs.com/wuxiangli/p/8734600.html
Copyright © 2011-2022 走看看