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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

有效的避免代码提交冲突,有效的避免git提交冲突

發布時間:2024/3/26 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 有效的避免代码提交冲突,有效的避免git提交冲突 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Microsoft Windows [版本 10.0.17763.1577] (c) 2018 Microsoft Corporation。保留所有權利。D:\work\HCC\platform>git pull warning: redirecting to https://sys-gitlab.hikvision.com.cn/IPSC/web/Bumblebee/platform.w/platform.git/ Updating 202ec548..f044c9b1 Fast-forward.../libs/jsWebControl/jsWebControl-1.0.0.min.js | 29806 ++++++++++++++++++-src/Common/vue/service/router/pathNameRule.js | 18 +-.../image/common/common_status_fail_grey.svg | 7 +.../vue/assets/less/hcc-icomoon/fonts/icomoon.eot | Bin 322400 -> 323472 bytes.../vue/assets/less/hcc-icomoon/fonts/icomoon.svg | 4 +.../vue/assets/less/hcc-icomoon/fonts/icomoon.ttf | Bin 322236 -> 323308 bytes.../vue/assets/less/hcc-icomoon/fonts/icomoon.woff | Bin 322312 -> 323384 bytes.../vue/assets/less/hcc-icomoon/style.css | 22 +-src/HCCCommon/vue/assets/less/icons.less | 4 +src/HCCCommon/vue/components/AreaTree.vue | 21 +-src/HCCCommon/vue/components/Drawer.vue | 9 +-src/HCCCommon/vue/connect/vsm.connect.ts | 2 +src/HCCCommon/vue/http/isapi.js | 4 +-src/HCCCommon/vue/libs/webControlDowload.js | 156 +-src/HCCCommon/vue/service/router/pathNameRule.js | 3104 +-src/HCCCommon/vue/webcontrol/LocalFilePlayBack.vue | 2 +-src/HCCCommon/vue/webcontrol/PreviewControl.vue | 2 +-.../libs/jsWebControl/jsWebControl-1.0.0.min.js | 29794 +++++++++++++++++-18 files changed, 60128 insertions(+), 2827 deletions(-)create mode 100644 src/HCCCommon/vue/assets/image/common/common_status_fail_grey.svgD:\work\HCC\platform>cd src/hccportalD:\work\HCC\platform\src\HCCPortal>git puyll git: 'puyll' is not a git command. See 'git --help'.The most similar command ispullD:\work\HCC\platform\src\HCCPortal>git pull error: Your local changes to the following files would be overwritten by merge:assets/static/i18n/en/label.jsonassets/static/i18n/zh_CN/label.json Please commit your changes or stash them before you merge. Aborting Updating ede86b8..0f0c936D:\work\HCC\platform\src\HCCPortal> D:\work\HCC\platform\src\HCCPortal>git pull remote: Enumerating objects: 9, done. remote: Counting objects: 100% (9/9), done. remote: Compressing objects: 100% (5/5), done. remote: Total 5 (delta 4), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (5/5), 636 bytes | 2.00 KiB/s, done. From https://sys-gitlab.hikvision.com.cn/IPSC/web/Bumblebee/hccportal/hccportal0f0c936..890914b master -> origin/master Updating files: 100% (25/25), done. Updating ede86b8..890914b Fast-forwardassets/img/android.svg | 1 +assets/img/bg_cube_hcc_VMS.png | Bin 378872 -> 324819 bytesassets/img/bg_cube_hcc_vehicle.png | Bin 409489 -> 350128 bytesassets/img/common_feedback_warning_sm.svg | 7 +assets/img/image_cloud_car_bg.svg | 446 +assets/img/image_cloud_car_sm.svg | 432 +assets/img/image_cloud_video_bg.svg | 335 +assets/img/image_cloud_video_sm.svg | 321 +assets/img/ios.svg | 1 +assets/static/favicon.ico | Bin 0 -> 13054 bytesassets/static/i18n/en/huiLan.json | 4 +-assets/static/i18n/en/label.json | 26189 ++++++++++++++--------------assets/static/i18n/en/msg.json | 8612 +++++----assets/static/i18n/zh_CN/huiLan.json | 4 +-assets/static/i18n/zh_CN/label.json | 26079 +++++++++++++--------------assets/static/i18n/zh_CN/msg.json | 8616 +++++----buryPoint/index.js | 28 +-common/header/BaseHeader.vue | 37 +-view/home/CameraItem.vue | 3 +view/home/CarItem.vue | 3 +view/home/DeviceOverrunTips.vue | 89 +view/home/HCCHome.vue | 1791 +-view/home/PackageChoose.vue | 8 +-view/home/QuickEntryList.vue | 2 +-view/login/Login.vue | 210 +-25 files changed, 37624 insertions(+), 35594 deletions(-)create mode 100644 assets/img/android.svgcreate mode 100644 assets/img/common_feedback_warning_sm.svgcreate mode 100644 assets/img/image_cloud_car_bg.svgcreate mode 100644 assets/img/image_cloud_car_sm.svgcreate mode 100644 assets/img/image_cloud_video_bg.svgcreate mode 100644 assets/img/image_cloud_video_sm.svgcreate mode 100644 assets/img/ios.svgcreate mode 100644 assets/static/favicon.icocreate mode 100644 view/home/DeviceOverrunTips.vueD:\work\HCC\platform\src\HCCPortal>git push To https://sys-gitlab.hikvision.com.cn/IPSC/web/Bumblebee/hccportal/hccportal.git! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://sys-gitlab.hikvision.com.cn/IPSC/web/Bumblebee/hccportal/hccportal.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.D:\work\HCC\platform\src\HCCPortal>git pull remote: Enumerating objects: 13, done. remote: Counting objects: 100% (13/13), done. remote: Compressing objects: 100% (7/7), done. remote: Total 7 (delta 6), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (7/7), 614 bytes | 2.00 KiB/s, done. From https://sys-gitlab.hikvision.com.cn/IPSC/web/Bumblebee/hccportal/hccportal890914b..1e7efeb master -> origin/master Auto-merging assets/static/i18n/en/label.json Merge made by the 'recursive' strategy.assets/static/i18n/en/label.json | 6 +++---1 file changed, 3 insertions(+), 3 deletions(-)D:\work\HCC\platform\src\HCCPortal>git push Enumerating objects: 45, done. Counting objects: 100% (39/39), done. Delta compression using up to 6 threads Compressing objects: 100% (21/21), done. Writing objects: 100% (21/21), 39.76 KiB | 6.63 MiB/s, done. Total 21 (delta 17), reused 0 (delta 0) To https://sys-gitlab.hikvision.com.cn/IPSC/web/Bumblebee/hccportal/hccportal.git1e7efeb..5a6dffb master -> masterD:\work\HCC\platform\src\HCCPortal>

第一:

git pull 一下,然后可以看到警告信息(可以看到具體是哪些文件沖突,然后對比找出具體是那個位置出現沖突,然后將改動的代碼復制出去,然后將本地代碼的修改給還原):

D:\work\HCC\platform\src\HCCPortal>git pull error: Your local changes to the following files would be overwritten by merge:assets/static/i18n/en/label.jsonassets/static/i18n/zh_CN/label.json Please commit your changes or stash them before you merge. Aborting Updating ede86b8..0f0c936

第二,再次執行,git pull (這樣就可以順利的拉取到最新的代碼):

第三,將自己改動的代碼給復制進去。

第四,就可以進行代碼提交操作了。

很多人都是git add . git commit -m “” 然后git push 之后發現代碼沖突了,gg,上述的解決很有效

------------------------------------------------------------上一階段結束-----------------------------------------------------

當然當你 執行 git add . —> git commit -m" " ----> git push 之后會報錯 會建議你使用git pul

PS F:\_practice\practice_git_order> git push To github.com:imkf-zhang/practice_git_order.git! [rejected] zkf-fz -> zkf-fz (fetch first) error: failed to push some refs to 'git@github.com:imkf-zhang/practice_git_order.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.

git pull 之后編輯器就會出現如下(Accept的不要選,只要選了就不可逆了(指的是最終以那種方案為準),可以選擇Compare Canges看看差異):

------------------------------------------------------------上一階段結束-----------------------------------------------------
注意地方:

git pull 指的是你本地改變了文件,并且保存(ctrl + s)了,這個改變的文件和遠程倉庫沖突了然后導致git pull不成功

本地倉庫上次git pull 之后,然后又有人往遠程倉庫推送代碼了,但是本地倉庫你本身并沒有做什么改變,那么此時你去git pull 是可以成功

git pull 會把沒有沖突的文件跟遠程倉庫更新,但是有沖突的就不回更新 這個觀點是錯誤的 × 會都不更新

------------------------------------------------------------上一階段結束-----------------------------------------------------
vscode 中對于git的操作:

其實vscode中對于git的操作,只是優化了 ==git add ~ ; git commit -m""==的操作,然后還需要打開git面板進行git push操作。

總結

以上是生活随笔為你收集整理的有效的避免代码提交冲突,有效的避免git提交冲突的全部內容,希望文章能夠幫你解決所遇到的問題。

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