• git 基本命令


    git status 查看状态

    git add . 把所以文件提交到暂存区

    git commit -m "add files"  把所有文件提交到版本区

    rm 1.txt 删除文件
    git reset --hard 哈希值   本地库恢复
    set nu 添加行号
    git diff 《文件》 文件与暂存区比较
    git diff head/哈希 《文件名》文件与本地库比较 head为当前的指针
    git branch -v 查看分支
    git branch 《分支名》 创建分支
    git branch    查看本地所有分支
    git branch -r   查看远程所有分支
    git branch -a   查看本地和远程的所有分支
    git branch -d 删除本地分支
    git branch -m <oldName> <newName> 重命名分支
    git checkout 《分支名》 切换分支
    git merge 《分支名》 把当前分支更新为指定的分支
    mkdir <name> 新建文件夹
    git remote -v 查看别名
    git remote add <name> <url> 给URL添加别名
    git remote set-url <name> <url>  修改URL
     
    git push <remote> master  把内容推送到远程仓库
    git clone <url>  克隆远程仓库
    git fetch <url> <branch> 拉取远程仓库到本地(并不更改本地内容)
    git checkout <url>/<branchName>   切换到远程分支
    cat <fileName> 查看刚刚拉取的内容
    git pull <url> <branchName> 拉取远程仓库内容并更新当前分支
    冲突状态提交到本地库不需要加上文件名
  • 相关阅读:
    字符串替换
    字符串查找
    字符串比较
    字节与字符串相互转换
    1365. How Many Numbers Are Smaller Than the Current Number
    1486. XOR Operation in an Array
    1431. Kids With the Greatest Number of Candies
    1470. Shuffle the Array
    1480. Running Sum of 1d Array
    【STM32H7教程】第56章 STM32H7的DMA2D应用之刷色块,位图和Alpha混合
  • 原文地址:https://www.cnblogs.com/p201821460026/p/13872621.html
Copyright © 2020-2023  润新知