随笔分类 -  git常用操作

记录git的常见操作
摘要:chmod +x script.sh git update-index --chmod=+x script.sh 阅读全文
posted @ 2024-04-01 08:30 浅情1314 阅读(21) 评论(0) 推荐(0)
摘要:重写文件后需要使能gitignore需要删除缓存,添加所有文件 提交 推送 git rm -r --cached . # 删除缓存 git add . #重写添加文件,ignore的文件不填加 git commit -m "add gitignore" git push origin master 阅读全文
posted @ 2023-03-10 15:26 浅情1314 阅读(45) 评论(0) 推荐(0)
摘要:一:新建一个分支 git branch -b dev 二:删除一个分支 git branch -d dev 三:修改本地分支的名称 git branch -m <原分支名称> <新分支名称> 四:新建并切换到一个分支 git checkout -b dev 五:查看关联关系 git branch - 阅读全文
posted @ 2023-02-21 13:37 浅情1314 阅读(36) 评论(0) 推荐(0)
摘要:方法一:merge操作 1.将当前分支修改数据commit git commit -m "this is local branch commit" 2.将分支切换到主分支 git checkout master 3.拉取主分支的最新代码 git pull origin master 4.合并分支代码 阅读全文
posted @ 2023-02-21 13:24 浅情1314 阅读(3529) 评论(0) 推荐(0)
摘要:查看git的缓存区中信息可以使用以下操作 git缓存区查看操作 git ls-files --cached //(-c) //查看暂存区中文件,git ls-files 命令默认是此命令 git ls-files--midified //(-m)查看修改的文件 git ls-files --dele 阅读全文
posted @ 2023-02-17 13:54 浅情1314 阅读(240) 评论(0) 推荐(0)
摘要:Git global setup git config --global user.name "liulei1" git config --global user.email "liulei1@wanji.net.cn" Create a new repository git clone ssh:/ 阅读全文
posted @ 2023-02-17 10:32 浅情1314 阅读(37) 评论(0) 推荐(0)