<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                一、stash them before you can merge. 解決辦法 問題: 使用git pull更新代碼的時候,遇到如下問題: $ git pull origin master From git.91als.net:root/yyg * branch master -> FETCH_HEAD Updating 09ee8ce..cd4108e error: Your local changes to the following files would be overwritten by merge: iad.html Please, commit your changes or stash them before you can merge. Aborting 出現這個問題,是由于其他人修改了***.html文件,然后提交到遠程版本庫咯。而你本地倉庫也修改了***.html 思路1: 保留本地的修改 * git commit 把本地修改提交到版本庫 $ git commit -m "add iad.html" On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean * git stash 將工作區恢復到上次提交之前,同時備份本地所做的修改 $ git stash Saved working directory and index state WIP on master: 09ee8ce add aa HEAD is now at 09ee8ce add aa (把本地的修改保存起來) lsf@lsf-PC MINGW32 /d/yyg/yyg (master) $ ll |grep iad.html (查看發現沒有這個文件) * git pull 可以正常拉取代碼咯 $ git pull origin master From git.91als.net:root/yyg * branch master -> FETCH_HEAD Updating 09ee8ce..cd4108e Fast-forward iad.html | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 iad.html * git stash pop: 從Git棧中讀取最近一次保存的內容 $ git stash pop Auto-merging iad.html CONFLICT (add/add): Merge conflict in iad.html (這表示文件有沖突,我們就要解決沖突) <<<<<<< Updated upstream this isasfd weqr sdf ======= this is asdf sadfsadf weri >>>>>>> Stashed changes ~ (此時就需要協助,到底用誰的代碼咯,然后添加到本地版本庫,在提交到遠程倉庫) $ git add . lsf@lsf-PC MINGW32 /d/yyg/yyg (master) $ git commit -m "modify iad.html" [master 6d2dc0a] modify iad.html 1 file changed, 3 insertions(+), 3 deletions(-) lsf@lsf-PC MINGW32 /d/yyg/yyg (master) $ git push origin master Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 278 bytes | 0 bytes/s, done. Total 3 (delta 1), reused 0 (delta 0) To gitlab@git.91als.net:root/yyg.git cd4108e..6d2dc0a master -> master 最后 git stash clear: 清空Git棧 二、error: failed to push some refs $ git push origin master To git.91als.net:root/yyg.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'gitlab@git.91als.net:root/yyg.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and 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. 解決: 我們需要先把遠程版本庫上的更新先pull到本地 $ git pull origin master From git.91als.net:root/yyg * branch master -> FETCH_HEAD Already up to date. 還有一種可能,是遠程倉庫有這個問題,發生了沖突,我們就需要看遠程倉庫里的這個文件,和本地的這個文件,然后做一個對比咯 三)error: failed to push some refs to '../remote/' 問題: $ git push To ../remote/ ! [rejected]? ? ? ? master -> master (non-fast-forward) error: failed to push some refs to '../remote/' 或者: $ git push origin master To git.91als.net:root/yyg.git ! [rejected] master -> master (fetch first) error: failed to push some refs to 'gitlab@git.91als.net:root/yyg.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. 問題 (Non-fast-forward) 的出現原因在于: git remote 倉庫中已經有一部分代碼, 所以它不允許你直接把你的代碼覆蓋上去. 解決: 1)先fetch到本地 $ git fetch remote: Counting objects: 6, done. remote: Compressing objects: 100% (4/4), done. remote: Total 6 (delta 2), reused 0 (delta 0) Unpacking objects: 100% (6/6), done. From git.91als.net:root/yyg cd4108e..b095b9e master -> origin/master Administrator@WIN-0JU14CFTKDB MINGW32 ~/Desktop/yyg (master) 2)然后合并(發現有沖突) $ git merge Auto-merging test.html CONFLICT (add/add): Merge conflict in test.html Automatic merge failed; fix conflicts and then commit the result. Administrator@WIN-0JU14CFTKDB MINGW32 ~/Desktop/yyg (master|MERGING) $ vim test.html (解決沖突) 然后在通過git add,git commit 提交到本地版本庫,然后push到遠程倉庫,發現可以咯 $ git commit [master 56caf41] Merge remote-tracking branch 'refs/remotes/origin/master' Administrator@WIN-0JU14CFTKDB MINGW32 ~/Desktop/yyg (master) $ git push origin master Counting objects: 6, done. Delta compression using up to 4 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (6/6), 565 bytes | 80.00 KiB/s, done. Total 6 (delta 2), reused 0 (delta 0) To git.91als.net:root/yyg.git b095b9e..56caf41 master -> master 四) $ git push test_dev fatal: 'test_dev' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 解決辦法: $ git push origin test_dev Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 276 bytes | 69.00 KiB/s, done. Total 3 (delta 1), reused 0 (delta 0) remote: remote: To create a merge request for test_dev, visit: remote: http://git.91als.net/root/yyg/merge_requests/new?merge_request%5Bsource_branch%5D=test_dev remote: To git.91als.net:root/yyg.git * [new branch] test_dev -> test_dev
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看