| git config user.name |
| git config user.email |
| |
| git config user.email "xxxx@xx.com" |
| git config user.name "xxxx" |
| |
| git remote -v |
| |
| git remote |
| |
| git remote rm origin |
| |
| git remote add github git@github.com:用户名/仓库名.git |
| |
| git push github main |
| git remote add origin https: |
| git clone git@github.com:用户名/仓库名.git |
| # 添加到暂存区 |
| |
| git add 文件名 |
| |
| git add 文件夹1/ 文件夹2/ |
| |
| git add . |
| |
| # 提交到本地仓库 |
| git commit -m "备注" |
| |
| # 第1次推送 |
| git push -u origin main |
| |
| # 推送 |
| git push origin main |
| |
| git branch |
| |
| git branch <name> |
| |
| git checkout <name> |
| |
| git checkout -b <name> |
| |
| |
| git merge <name> |
| |
| |
| git merge dev |
| |
| git merge --no-ff -m "备注" <name> |
| |
| |
| git push origin dev |
| |
| |
| |
| git branch -D dev |
| |
| git push origin -d dev |
| |
| git pull origin main |
| |
| |
| git pull --rebase <远程主机名> <远程分支名>:<本地分支名> |
| |
| git pull --rebase origin main |
| |
| git pull --rebase origin dev:main |
| |
| git status |
| |
| On branch main |
| Changes to be committed: |
| (use "git restore --staged <file>..." to unstage) |
| modified: 1.txt |
| |
| Untracked files: |
| (use "git add <file>..." to include in what will be committed) |
| 2.txt |
| |
| |
| |
| git status |
| |
| On branch main |
| Changes not staged for commit: |
| (use "git add/rm <file>..." to update what will be committed) |
| (use "git restore <file>..." to discard changes in working directory) |
| modified: 1.txt |
| deleted: 2.txt |
| |
| no changes added to commit (use "git add" and/or "git commit -a") |
| |
| git log |
| |
| git log --pretty=oneline |
| |
| git log --decorate --graph --oneline --all |
| |
| git log --pretty=oneline --abbrev-commit |
| |
| git log --graph |
| |
| |
| |
| git checkout -- file |
| |
| |
| git reset HEAD file |
| //丢弃工作空间 |
| git checkout -- file |
| |
| |
| git reset --hard HEAD^ |
| |
| |
| git reset --hard 1094a |
| |
| |
| git rm <filename> |
| |
| |
| git rm <filename> --cached |
| |
| |
| rm <filename> |
| |
| git rm <filename> |
| |
| git commit -m 'delete a file' |
| |
| git checkout -- <filename> |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
2021-07-13 spring boot应用常用配置
2021-07-13 promise对象