zoukankan      html  css  js  c++  java
  • git常用命令1

    git clone   #克隆远程仓库的项目到本地

    git config --global user.name ""    #查看或设置贡献者的名字

    git config --global user.email ""    #查看或设置贡献者的邮箱

    git config --list   #查看所有配置选项

    git status    #查看当前状态

    git add <filename> # 将工作文件修改提交到本地暂存区

    git add . # 将所有修改过的工作文件提交暂存区

    git commit -m ""  #将暂存区修改提交到版本去并添加注释

    git commit -a -m ""  #上面两个命令的合体,将工作区文件修改提交到暂存区,并且提交到版本区,提交信息。

    git diff <file> # 比较当前文件和暂存区文件差异

    git diff --staged # 比较暂存区和版本库差异

    git diff --cached # 比较暂存区和版本库差异

    git reset HEAD <file.name>、、

    git checkout -- <file.name>、、

    git commit --amend 修改最后一次提交

    git rm <file.name>

    git rm -f <file.name>

    git rm --cached <file.name>

    git checkout commit_id <file.name>恢复某个版本的具体文件

    git reset --hard commit_id 恢复到某个版本

    HEAD^ HEAD~<num>恢复到前一个或者几个版本

    git reflog  查看日志

    git remote 查看仓库名

    git remote -v 查看仓库地址

    git push origin(仓库名) master(分支)    同步到远程仓库

  • 相关阅读:
    tr 字符转换命令
    Log4cpp配置文件及动态调整日志级别的方法
    Ubuntu使用总结
    vim安装与配置(进阶版)
    [转载] Linux CC与GCC的区别
    C语言基础总结
    VIM之ctags & Taglist 插件
    vim之基础配置
    使用问题:Chrome卡死崩溃
    Ubuntu16.10安装之后的软件安装
  • 原文地址:https://www.cnblogs.com/toodeep/p/4819729.html
Copyright © 2011-2022 走看看