日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

实际应用中git(合并本地与服务器项目)

發布時間:2025/3/18 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 实际应用中git(合并本地与服务器项目) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

在服務器直接操作后 本地要做合并操作? 否則push會報錯誤

$ git push
To https://gitee.com/zdbgit/2048.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://zdbgit:wmzyq2013@gitee.com/zdbgit/2048.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

?

1、(先進入項目文件夾)通過命令 git init 把這個目錄變成git可以管理的倉庫

git init

2、把文件添加到版本庫中,使用命令 git add .添加到暫存區里面去,不要忘記后面的小數點“.”,意為添加文件夾下的所有文件

git add .

3、用命令 git commit告訴Git,把文件提交到倉庫。引號內為提交說明

git commit -m 'first commit'

4、關聯到遠程庫

git remote add origin 你的遠程庫地址

如:

git remote add origin https://github.com/cade8800/ionic-demo.git

5、獲取遠程庫與本地同步合并(如果遠程庫不為空必須做這一步,否則后面的提交會失敗)

git pull --rebase origin master

6、把本地庫的內容推送到遠程,使用 git push命令,實際上是把當前分支master推送到遠程。執行此命令后會要求輸入用戶名、密碼,驗證通過后即開始上傳。

git push -u origin master

*、狀態查詢命令

git status

備:詳細請參考?http://www.cnblogs.com/tugenhua0707/p/4050072.html

?

?

轉載于:https://www.cnblogs.com/zhang-bin/p/9772454.html

總結

以上是生活随笔為你收集整理的实际应用中git(合并本地与服务器项目)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。