Git基本使用

找一个文件夹

git init

代码仓库,里面的内容千万不要动

新建一个文件,如test.txt

复制代码
git add test.txt
//git add .  //all

暂存区

复制代码
git commit -m "新增了一个点赞"

最常用的流程:

修改一个文件

git add

git commit

复制代码
git log  //查看节点
git log --stat //查看修改了什么文件

commit id

复制代码
git diff id

git 管理工具如pycharm

回溯

复制代码
git reset --hard [commit id]
git checkout [commit id]

分支

复制代码
git branch

查看哪些分支

复制代码
git checkout -b develop //新建分支
git branch

建立完毕 需要合并 develop->master

复制代码
git add .
git commit -m "新增了关注和转发功能"
git checkout master
git merge develop
相关推荐
fu的博客1 小时前
Git从删库到跑路
git·gitee·github
知识即是力量ol2 小时前
Git 实战指南:从分支管理到冲突解决
git·github·源代码管理
基于底层的菜鸟2 小时前
如何在VS code中为GitHub Copilot 添加SKill
github
玉梅小洋2 小时前
GitHub SSH配置教程
运维·ssh·github
牛十二3 小时前
在github codespaces部署开源个人智能体OpenClaw(Clawdbot/Moltbot)使用教程
github
CoderJia程序员甲3 小时前
GitHub 热榜项目 - 日榜(2026-02-01)
人工智能·ai·大模型·github·ai教程
散峰而望3 小时前
【基础算法】穷举的艺术:在可能性森林中寻找答案
开发语言·数据结构·c++·算法·随机森林·github·动态规划
散峰而望3 小时前
【基础算法】算法的“预谋”:前缀和如何改变游戏规则
开发语言·数据结构·c++·算法·github·动态规划·推荐算法
roamingcode3 小时前
我是如何 Vibe Coding,将 AI CLI 工具从 Node.js 迁移到 Rust 并成功发布的
人工智能·rust·node.js·github·claude·github copilot
掘根14 小时前
【jsonRpc项目】发布/订阅模块
github