Git 基本操作

12 篇文章 0 订阅

Git详述:https://mp.csdn.net/mp_blog/creation/editor/119935707

Git 安装配置:https://blog.csdn.net/li6472/article/details/119935707

Git 工作流程:https://mp.csdn.net/mp_blog/creation/editor/119945322

Git 工作区、暂存区和版本库:https://mp.csdn.net/mp_blog/creation/editor/119945402

Git 创建仓库:https://mp.csdn.net/mp_blog/creation/editor/119948151

Git 分支管理:https://mp.csdn.net/mp_blog/creation/editor/119951024

Git 查看提交历史:https://mp.csdn.net/mp_blog/creation/editor/119951662

Git 标签:https://mp.csdn.net/mp_blog/creation/editor/119951922

Git 远程仓库(Github):https://mp.csdn.net/mp_blog/creation/editor/119952396

Git Gitee:https://mp.csdn.net/mp_blog/creation/editor/119953973

Git 服务器搭建:https://mp.csdn.net/mp_blog/creation/editor/119954105

git clonegit pushgit add 、git commitgit checkoutgit pull

说明:

  • workspace:工作区
  • staging area:暂存区/缓存区
  • local repository:版本库或本地仓库
  • remote repository:远程仓库

一个简单的操作步骤:

git init - 初始化仓库。
git add . - 添加文件到暂存区。
git commit - 将暂存区内容添加到仓库中。

创建仓库命令

下表列出了 git 创建仓库的命令:

命令说明
git init初始化仓库
git clone拷贝一份远程仓库,也就是下载一个项目。

提交与修改

Git 的工作就是创建和保存你的项目的快照及与之后的快照进行对比。

下表列出了有关创建与提交你的项目的快照的命令:

命令说明
git add添加文件到仓库
git status查看仓库当前的状态,显示有变更的文件。
git diff比较文件的不同,即暂存区和工作区的差异。
git commit提交暂存区到本地仓库。
git reset回退版本。
git rm删除工作区文件。
git mv移动或重命名工作区文件。

提交日志

命令说明
git log查看历史提交记录
git blame <file>以列表形式查看指定文件的历史修改记录

远程操作

命令说明
git remote远程仓库操作
git fetch从远程获取代码库
git pull下载远程代码并合并
git push上传远程代码并合并

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值