1. git status查看当前本地分支修改状态
    在这里插入图片描述

  2. git diff 文件路径 查看具体文件修改内容
    在这里插入图片描述

  3. git log打印用户信息
    在这里插入图片描述

  4. git remote -v查看远程地址在这里插入图片描述

  5. git checkout -- *还原删除文件

  6. git rm -r --force .删除本地所有文件
    在这里插入图片描述

  7. git commit -m "Remove all files from repository"提交所有代码在这里插入图片描述

  8. git clone 克隆项目
    在这里插入图片描述

  9. git remote add 添加远程地址
    在这里插入图片描述

  10. git add 添加所有文件
    在这里插入图片描述

  11. git push -u origin master 推送
    在这里插入图片描述

  12. git log 分页 or 退出

  1. repo 使用
    初始化仓库
    repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest
    在这里插入图片描述
    下载单仓
    repo sync platform/frameworks/base
    repo sync platform/frameworks/native
    repo sync packages/apps/Launcher3
    repo sync packages/apps/Settings

参看对应分支
cd manifest
git branch 查看当前分支
git branch -a 查看所有分支
git branch -a |grep android11-
切换分支
git checkout -b android-8.0.0_r17 origin/android-8.0.0_r17

14 .git撤销文件修改
git checkout -- 文件名

15 .撤销到最近一次提交
git reset --hard HEAD

原文地址:https://blog.csdn.net/qq_20330595/article/details/134042749

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_14737.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注