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
相关推荐
用户773530084511 小时前
gorillamux:Go语言路由库的实用选择
github
BBWEYY终身尊贵会员2 小时前
2026年6月四款建站工具怎么选?BBWEYY、比文云、GitHub Copilot、Dreamweaver 简明对比
github·copilot·dreamweaver
MicrosoftReactor2 小时前
技术速递|从一次性提示到标准化工作流:如何在 GitHub Copilot CLI 中使用自定义智能体
github·copilot·cli·智能体
Png2 小时前
我被腾讯 ACE 反作弊逼疯了,最后靠一个 PowerShell 脚本治好了精神内耗
github
OpenIM3 小时前
增量版本同步能力介绍 | OpenIM
开源·github·信息与通信
lpfasd12315 小时前
2026年第24周科技社区趋势周报
github
今夕资源网18 小时前
github开源 网页在线音频转文本工具 node.js+html源码
github·音频转文本·音频转字幕·音频转srt·音频转srt字幕文件·音频转lrc·音频转txt
得要找到一束光19 小时前
git详细命令
git·github
LeahDizon20 小时前
AI Coding 协作实践方案
程序员·github·代码规范
2601_9618752421 小时前
花生十三公考课程|网课|视频
数据库·windows·git·svn·eclipse·github