zoukankan      html  css  js  c++  java
  • [Git] 常用操作速查

    记录了本人在科研中常用到的git操作,方便查询,内容并不全面,更多功能等用到的时候再加

    基础操作:

    初始化仓库

    git init

    克隆仓库/克隆仓库的指定分支

    git clone <URL>
    git clone -b branch_name <URL>

    添加、提交全部修改

    git add .
    git commit -m "message"

    分支操作

    显示当前branch
    git branch

    本地分支重命名
    git branch -m oldname newname

    显示本地和远程所有branch
    git branch -a

    创建并切换新分支
    git checkout -b branch_name
    等价于:
    git checkout branch_name
    git branch branch_name

    删除本地分支
    git branch -d branch_name

    删除远程分支
    git push --delete remote_name branch_name

    Remote操作

    git remote [-v | --verbose]  显示所有remote,-v显示remote更多信息
    git remote add [-t <branch>] [-m <master>] [-f] [--[no-]tags] [--mirror=<fetch|push>] <name> <url>
    git remote rename <old> <new>
    git remote remove <name>
    git remote set-head <name> (-a | --auto | -d | --delete | <branch>)
    git remote set-branches [--add] <name> <branch>…​
    git remote get-url [--push] [--all] <name>
    git remote set-url [--push] <name> <newurl> [<oldurl>]
    git remote set-url --add [--push] <name> <newurl>
    git remote set-url --delete [--push] <name> <url>
    git remote [-v | --verbose] show [-n] <name>…​
    git remote prune [-n | --dry-run] <name>…​
    git remote [-v | --verbose] update [-p | --prune] [(<group> | <remote>)…​]
    
  • 相关阅读:
    uboot串口与标准输入输出代码详解
    uboot打开Debug
    git添加公钥后报错sign_and_send_pubkey: signing failed: agent refused operation的解决办法
    git 代码管理工具,很不错,值得推荐
    Ubuntu 压缩解压命令
    OMAPL138调试笔记
    网络
    关于运放
    win7 linux 双系统删除linux & 双系统安装
    dedecms 蜘蛛抓取设置 robots.txt
  • 原文地址:https://www.cnblogs.com/geoli/p/13304862.html
Copyright © 2011-2022 走看看