zoukankan      html  css  js  c++  java
  • git 使用记录


    --拷指定分支的提交到另一分支

    1、切换分支到V1.0.10:git checkout V1.0.10

    2、git log 查看V1.0.9分支的前七位符号

    3、在V1.0.10上git reset --hard c1d5362(V1.0.9前七位符号)

    4、然后正常执行 git add .
    ----
    #本地可以彻底恢复到你想恢复到的版本了 HEAD~1 代表最后提交
    git reset --hard 58093e1355716f0f861b64f1c3dfe59242be28f7
    --强制更新远端的数据(上面的做了只删除了本地的.要同步到服务器需要执行下面的操作)
    git push --force


    --产生一个新提交.回滚到指定版本
    git revert 58093e1355716f0f861b64f1c3dfe59242be28f7

    --推送标记去远端(v1.0是标记的名字)
    git push origin v1.0

    --推送所有标记去无端
    git push origin --tags

    --获取当前分支的名字
    git symbolic-ref --short -q HEAD

    1.git强制覆盖本地文件(与git远程仓库保持一致):
    git fetch --all
    git reset --hard origin/master ( git reset --hard origin/features/Trunk)
    git pull
    git强制覆盖本地命令(单条执行):
    git fetch --all && git reset --hard origin/master && git pull

    2.git强制推送本地代码到远程仓库
    切换到对应的要上传文件的文件夹下面执行命令
    git push -u origin develop

  • 相关阅读:
    PHP安装linux
    nginx 安装
    Redis安装
    linux启动http服务
    收藏的有用的网页
    laravel框架部署后有用命令
    .net 报错access to the path c: empimagefilesmsc_cntr_0.txt is denied
    oracle 触发器
    学习Auxre记录
    mysql数据库索引
  • 原文地址:https://www.cnblogs.com/itstac/p/12408367.html
Copyright © 2011-2022 走看看