# git学习 **Repository Path**: wangwei289/gitbashtest ## Basic Information - **Project Name**: git学习 - **Description**: 学习git bash的使用 - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-01-22 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 仓库练习 #### 介绍 学习git bash的使用 #### 使用说明 git bash学习:git(分布式)svn(集中式) 1. git init(初始化) 2. git status 3. git add . 4. git commit -m "第一次git add+commit" 5. git status 7. git add index.html 8. git status 9. git commit -m "修改文件" 10. git status 11. git rm index.php;git commit -m "删除" 或者 rm index.php;git add index.php;git commit -m "删除" 12. git status 13. git push https://gitee.com/wangwei289/gitbashtest.git 15. git push https://gitee.com/wangwei289/gitbashtest.git master 16. git remote add gitbashtest https://gitee.com/wangwei289/gitbashtest.git 17. git push gitbashtest master 18. git log 19. git relog 20. git clone https://gitee.com/wangwei289/gitbashtest.git 21. git remote add gitbashtest https://gitee.com/wangwei289/gitbashtest.git 22. git remote -v 23. git remote remove gitbashtest 24. git pull gitbashtest master 25. git branch 26. git branch btest 27. git checkout btest 切换分支 28. git branch master;git merge btest;合并后注意处理冲突 29. 配置公钥登录(SSH公钥): 命令:ssh-keygen -rsa -C "xxx" 一路回车 生成id_rsa id(私)id_rsa_pub(公) 打开id_rsa_pub(公)添加到仓库管理 30. git config --list ;git config --global user.email "123456@qq.com" ; git config --global user.name "123456";更改提交人姓名 #### 参与贡献(来自hopher的点评 :+1: ) 1. rebase的使用 场景:多人协作时, 让git 线性流工作 知识点:git 工作流 https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/0015266568413773c73cdc8b4ab4f9aa9be10ef3078be3f000 2. 参考书籍 https://git-scm.com/book/zh/v2 3. 补充说明 空文件夹处理 场景:对于项目中, 某些文件夹是空的,但又是必须存在的(如:图片存储目录) 方法:find . \( -type d -empty \) -and \( -not -regex ./\.git.* \) -exec touch {}/.gitkeep \;