随笔分类 -  git使用

摘要:git reset HEAD <file> git checkout . git merge --abort 阅读全文
posted @ 2024-08-28 11:17 轻轻的吻 阅读(331) 评论(0) 推荐(0) 编辑
摘要:我们经常会用 git clone 来下载项目,但遇到大项目的时候,clone 就很慢,比要等很久。 当然,还有更慢的项目。这类项目可以通过 --depth 1 来加速: git clone --depth 1 https://github.com/facebook/react 这速度快了有几十倍吧! 阅读全文
posted @ 2023-05-26 10:36 轻轻的吻 阅读(76) 评论(0) 推荐(0) 编辑
摘要:git config --global user.name gerrit用户名 git config --global user.email 邮箱地址 git config --global core.editor vim git config --global diff.tool vimdiff 阅读全文
posted @ 2023-04-15 10:41 轻轻的吻 阅读(19) 评论(0) 推荐(0) 编辑
摘要:git clean -fdx && git checkout . 今天遇到 git clean -f 清除不了未被跟踪的文件。原因在于git clean -f 只删除已经被跟踪的目录中的新增文件,新增文件如果在“新增文件夹”则不会被删除1.删除untracked files: git clean - 阅读全文
posted @ 2023-04-10 15:17 轻轻的吻 阅读(128) 评论(0) 推荐(0) 编辑
摘要:vim ~/.gitconfig 把下面配置加进去 [core] editor = vim [diff] tool = vimdiff [color] ui = auto 阅读全文
posted @ 2023-03-16 20:15 轻轻的吻 阅读(102) 评论(0) 推荐(0) 编辑
摘要:git show commit-id 被修改的文件路径 阅读全文
posted @ 2023-02-20 14:49 轻轻的吻 阅读(45) 评论(0) 推荐(0) 编辑
摘要:git show --raw commit-id 阅读全文
posted @ 2023-02-20 12:25 轻轻的吻 阅读(18) 评论(0) 推荐(0) 编辑
摘要:一、通过git diff 命令生成patch文件1.还未提交的修改 git diff > commit.patch 2.已提交的修改 git diff 3da71ca35 8b5100cdcd > commit.patch 注)3da71ca35 在8b5100cdcd 前面3.已经add但是未co 阅读全文
posted @ 2022-11-01 17:08 轻轻的吻 阅读(2593) 评论(0) 推荐(0) 编辑
摘要:git remote -v 阅读全文
posted @ 2022-10-27 10:54 轻轻的吻 阅读(91) 评论(0) 推荐(0) 编辑
摘要:git log --pretty=oneline file 阅读全文
posted @ 2022-10-12 11:19 轻轻的吻 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-07-18 17:19 轻轻的吻 阅读(50) 评论(0) 推荐(0) 编辑
摘要:git reset --hard HEAD^ //表示回退到上一个版本 git pull --rebase //同步远程服务器的代码 阅读全文
posted @ 2021-09-10 20:15 轻轻的吻 阅读(1020) 评论(0) 推荐(0) 编辑
摘要:如果删除了本地某个文件,想重新下载,那么git pull 阅读全文
posted @ 2021-05-20 18:35 轻轻的吻 阅读(119) 评论(0) 推荐(0) 编辑
摘要:1、查看修改的文件 git status 2、添加文件: git add 文件名 git add -A 一键add 3、提交文件: git commit -m "提交文件时的说明" 4、推送到远程仓库: git push 5、撤销commit git reset --soft HEAD^ //注意: 阅读全文
posted @ 2021-04-29 15:40 轻轻的吻 阅读(73) 评论(0) 推荐(0) 编辑
摘要:1、查看本地属性 git config --local --list 2、修改全局的用户名和邮箱 git config --global user.name 你的目标用户名; git config --global user.email 你的目标邮箱名 3、修改当前project的用户名和邮箱 gi 阅读全文
posted @ 2021-04-29 15:36 轻轻的吻 阅读(1536) 评论(0) 推荐(1) 编辑
摘要:在终端下执/行: git config --global credential.helper store 可以看到~/.gitconfig文件,会多了一项: 阅读全文
posted @ 2021-04-10 15:34 轻轻的吻 阅读(87) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示