Git更新代码使用方法


问题

 在使用sourceTree过程中,项目太多的话容易造成使用上的错乱,针对一些不常用的项目可以使用git代码的方式进行合并

Git使用原理:https://www.cnblogs.com/zibinchen/p/13814229.html

Git分支管理:https://www.cnblogs.com/zibinchen/p/14136699.html

 

mac安装git:https://www.jianshu.com/p/7edb6b838a2e

git工作原理

把代码放到远程仓库,只需牢牢记住三个命令:
git add
git commit
git push

Git pull拉取最新代码

git pull

git status 查看本地和git上的不同

git status

git add . 添加新文件

git add . 

git status 变绿色就是提交暂存文件成功

git commit -m '' 描述变更信息

git commit -m '描述内容'

  

git push 合并到Git上

git push

  

克隆分支代码

git clone -b <分支名> <仓库地址>

 

切换分支

git checkout -b <分支>  <克隆地址>

GIT常用操作

git rm -r -f --cached */__pycache__ # 清除所有__pycache__

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM