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
相关推荐
苏灿烤鱼8 小时前
没有机密文件,也没有付费数据,在浏览器里造一颗"间谍卫星"
前端·javascript·github
粥里有勺糖11 小时前
视野修炼-技术周刊第131期 | Bun 与 pnpm Rust 化
前端·github·agent
旅之灵夫14 小时前
【GitHub项目推荐--HyperFrames:用 HTML 写视频,为 AI Agent 而生的渲染框架】
github
峰向AI15 小时前
阿里内部用了2年的代码审查工具开源了:21k Star背后的「工业级」设计
github
zandy101115 小时前
2026vibe coding背后 :Kimi Code、Cursor、Claude Code、GitHub Copilot等五款工具架构演进全面分析
架构·github·copilot
zandy101115 小时前
网络支付合规三重门:Kimi Code、Cursor、GitHub Copilot等五款AI编程工具国内实战测评
github·copilot·ai编程
ssshooter17 小时前
Tauri + GitHub Actions 自动化发布 Android APK 技术总结
android·github·android studio
wdfk_prog18 小时前
GitHub push 失败:如何扫描并清理 Git 历史中的大文件
git·elasticsearch·github
Da Zeng19 小时前
快速搭建GitHub Page
github