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