上傳代碼到 gitee + 更新代碼


首次上傳代碼
1、到有代碼文件夾的文件夾下
2、git bush here
3、git config --global user.name "fxx"
4、git config --global user.email "xxxxxxxx@163.com"
//直接使用git init會報錯,warning: LF will be replaced by CRLF in git/.gitignore.
//如果報錯(rm -rf .git        //刪除,再進行后面的步驟)
5、git config --global core.autocrlf false
6、git init 
7、git add .
8、git commit -m "first commit"
9、git remote add origin  https://xxxxxxxxxx.git
10、git push -u origin master
 
更新代碼
1、到有代碼文件夾的文件夾下
2、git bush here
3、git add .
4、git commit -m "xxx"
5、git push
 

如果更新報錯: Your branch is up-to-date with 'origin/master'.
1、git branch newbranch        //創建新分支
2、git branch        //檢查新分支是否創建成功
3、git checkout newbranch        //切換到新分支下
4、git add .        //添加代碼
5、git commit -m "second "
6、git status                    //檢查是否成功
7、git checkout master        //切換到主分支 
8、git merge newbranch        //將新分支改動的代碼合並到主分支
9、git push -u origin master        //push代碼
10、git branch -D newbranch        //最后還可以刪除這個分支
來源: https://www.jianshu.com/p/e25c763b9816
 

鏈接新文件夾到倉庫:
1、到有代碼文件夾的文件夾下
2、git bush here
3、git config --global user.name "fxx"
4、git config --global user.email "xxxxxxxx@163.com"
5、git init
6、git branch 分支名
7、git checkout 分支名
8、git add .
9、git commit -m "commit"
10、git remote add origin  https://xxxxxxxxxx.git
 
11、git push -u origin 分支名


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM