zoukankan      html  css  js  c++  java
  • git命令总结

    1. 错误提示:
    It seems that I cannot create a rebase-apply directory, and
    I wonder if you are in the middle of patch application or another rebase.

    2. git cherry-pick s807x 把s807x 这个一个点 拉倒当前分支。

    3. git push --force 强制

    4. a: git reflog;git reset HEAD@{7} 切回到7这个动作的提交点,参考reflog.

    b: git reset HEAD^ 回滚一个commit.

    5. git push SW3Server :tinno-job 删除服务器上的分支--tinno-job

    6. git commit --amend 修改提交的注释

    7. 本地修改多个部分,但是只提交部分, rebase 的时候提示冲突,
    解决: git stash
    2012 git rebase SW3Server/tinno-jb
    2013 git push SW3Server 9081-4.1:tinno-jb
    2014 git stash pop

    8. 把远程分支往后拉

    9. 查看某人的修改记录
    git log --stat --author=someone

    10. git status 出现:
    old mode 100755
    new mode 100644,解决方法是:
    git config --global core.filemode false
    git config core.filemode false

    11. git difftool mcw-gpu-realloc ./vp9/common/inter_ocl/opencl/ocl_wrapper.c 查看当前分支和mcw-gpu-realloc分支 ./vp9/common/inter_ocl/opencl/ocl_wrapper.c文件的差异

    12. git reset 重设缓冲区,但是工作目录不会改变。 git reset --hard 重设缓冲区和工作目录,它清除了所有未提交的更改。 如果你对之前的commit已经不在意了,可以用reset,否则还是建议checkout.

    13. git clean命令将未跟踪的文件从你的工作目录中移除。和一般的rm命令一样,git clean是无法撤消的,所以在删除未跟踪的文件之前想清楚,你是否真的要这么做

    git clean -n
    

    执行一次git clean的『演习』。它会告诉你那些文件在命令执行后会被移除,而不是真的删除它。

    git clean -f
    

    移除当前目录下未被跟踪的文件。-f(强制)标记是必需的,除非clean.requireForce配置项被设为了false (默认为true)。它 不会 删除 .gitignore中指定的未跟踪的文件。

    git clean -f <path>
    

    移除未跟踪的文件,但限制在某个路径下。

    git clean -df
    

    移除未跟踪的文件,以及目录。

    git clean -xf
    

    移除当前目录下未跟踪的文件,以及Git一般忽略的文件。

    13: git rebase -i

    用squash命令把两个提交并在一起就可以了:

    pick 32618c4 Start developing a feature
    squash 62eed47 Fix something from the previous commit

    14.  tag 操作
          git ls-remote 查看远程tag
          git tag -d v1.0.0  删除本地tag
          git push origin :refs/tags/v1.0.0 删除远程tag

  • 相关阅读:
    C#实现京东登录密码加密POST
    查询SQL Server数据库所有表字段备注
    DataGridView数值列和日期列
    (转)Android 系统 root 破解原理分析
    Dynamics AX 中重点数据源方法
    .NET中Debug模式与Release模式
    DotNetBar的初步使用
    省市区联动小功能
    多余的Using Namespaces或引用会影响程序的执行效率么?
    MSIL指令集
  • 原文地址:https://www.cnblogs.com/biglucky/p/4651464.html
Copyright © 2011-2022 走看看