赞
踩
git branch develop 创建develop分支 git log 查看日志 git checkout develop 切换到develop分支 git checkout - 切换回master分支 git checkout -b feature/notify 创建分支,并切换到该分支 小技巧( git checkout -b feature/chat develop 在develop分支上创建一个chat分支,并切换到chat分支) 开发 git add . git commit -m "xxx" git log git checkout develop 先回到develop分支 git merge feature/notify --no-ff 将notify分支合并到develop分支上,不管你是否超前了我 git branch -d feature/notify 删除分支
git checkout -b release/v4.0 增加版本号字样 git add . git commit -m "增加版本号v4.0" git log 修复bug git add . git commit -m "修复了1个bug" git checkout master git merge release/v4.0 --no-ff 将v4.0分支合并到master分支上 git checkout develop git merge release/v4.0 --no-ff 将v4.0分支合并到develop分支上 git branch -d release/v4.0 删掉这个分支
git tag v4.0
git branch hotfix/period
git checkout hotfix/period
修复bug
git add .
git commit -m "xxx"
git checkout master
git merge hotfix/period --no-ff
git tag v4.01
git checkout develop
git merge hotfix/period --no-ff
git branch -d hotfix/period
城中村:全局可能使用的是一个邮箱,但是,另外,可针对单独的工程进行设定
参考:https://blog.csdn.net/yjw123456/article/details/119696726
执行如下:
git remote rm origin
git remote add origin git@github.com:E******/****p.git
git remote set-url origin https://gh*******************j4@github.com/E****/***p.git
对该仓库的用户名、邮箱进行设定:
git config user.name "M*****a"
git config user.email "1*********@qq.com"
检查看看当前的配置:
git config --list
删除文件:
在本地仓库删除文件: git rm 要删除的文件名
在本地仓库删除文件夹: git rm -r 要删除的文件夹名
push时遇到问题:
git push origin xxx Enumerating objects: 1090, done. Counting objects: 100% (948/948), done. Delta compression using up to 16 threads Compressing objects: 100% (714/714), done. Writing objects: 100% (804/804), 366.47 MiB | 1.39 MiB/s, done. Total 804 (delta 519), reused 0 (delta 0) remote: Resolving deltas: 100% (519/519), completed with 117 local objects. remote: Powered by GITEE.COM [GNK-6.4] remote: error: File: ff25161653c617df66b0c91f5d5529a1de06f389 157.44 MB, exceeds 100.00 MB. remote: Use command below to see the filename: remote: git rev-list --objects --all | grep ff25161653c617df66b0c91f5d5529a1de06f389 remote: Please remove the file from history and try again. (https://gitee.com/help/articles/4232) To gitee.com:rekinus/BX_234.git ! [remote rejected] xxx -> xxx (pre-receive hook declined) error: failed to push some refs to '...'
解决办法:
查看大文件名称
git rev-list --objects --all | findstr ff25161653c617df66b0c91f5d5529a1de06f389
ff25161653c617df66b0c91f5d5529a1de06f389 java_pid5736.hprof
删除这个文件
git rm java_pid5736.hprof
删除提交中的这个文件
git filter-branch --force --index-filter "git rm --cached --ignore-unmatch java_pid5736.hprof" --prune-empty --tag-name-filter cat -- --all
强推到云:
git push -f origin 215
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。