<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      VS2017下使用Git遇到的問題

      我在使用最新版的VS2017時,想獲取服務(wù)器上最新代碼,F(xiàn)etch到了最新修改,但是在拉取代碼的時候出現(xiàn)了問題

      user@user-PC MINGW64 /d/demo/myrepos (dev-css)
      $ git pull origin dev-css
      From https://winleechina.visualstudio.com/_git/PartTimeJob
       * branch            dev-css    -> FETCH_HEAD
      error: Your local changes to the following files would be overwritten by merge:
              BaseSite/Code/.vs/BaseSite/v15/Server/sqlite3/storage.ide-shm
              BaseSite/Code/.vs/BaseSite/v15/Server/sqlite3/storage.ide-wal
              BaseSite/Code/.vs/BaseSite/v15/sqlite3/storage.ide-shm
              BaseSite/Code/.vs/BaseSite/v15/sqlite3/storage.ide-wal
      Please commit your changes or stash them before you merge.
      Aborting
      Updating d568290..cf89950
      
      user@user-PC MINGW64 /d/demo/myrepos (dev-css)
      $ git status
      On branch dev-css
      Your branch is behind 'origin/dev-css' by 8 commits, and can be fast-forwarded.
        (use "git pull" to update your local branch)
      
      Changes not staged for commit:
        (use "git add <file>..." to update what will be committed)
        (use "git checkout -- <file>..." to discard changes in working directory)
      
              modified:   BaseSite/Code/.vs/BaseSite/v15/Server/sqlite3/storage.ide-shm
              modified:   BaseSite/Code/.vs/BaseSite/v15/sqlite3/storage.ide-shm
      
      Untracked files:
        (use "git add <file>..." to include in what will be committed)
      
              .gitattributes
              .gitignore
      
      no changes added to commit (use "git add" and/or "git commit -a")
      
      

      于是我采用常規(guī)套路(簽入,或者撤銷checkout) 都是失敗,而且不能undo change其中兩個文件storage.ide-shm/storage.ide-shm;

      這個問題的最終結(jié)果就是導(dǎo)致我不能拉取最新代碼。

      好在在StackOverflow發(fā)現(xiàn)如下方法

          git rm [path_and_filename] --cached  //該命令將永遠(yuǎn)不想簽入的文件從索引(index)中移除,如果不想這個文件存在磁盤上,可以使用git rm [path_and_filename] --force
      
      1. 將操作后的文件(此時已經(jīng)是staged)提交就好了

      Ps:

      1. .gitignore 是最先想到的方法,但是也不行,不過SO上有人貌似是可以的,如下:
       # Visual Studio 2015 cache/options directory
       .vs/
      
      1. 微軟官檔:

      Permanently ignore changes to a file

      If a file is already tracked by Git, adding that file to your .gitignore is not enough to ignore changes to the file. You also need to remove the information about the file from Git's index
      These steps will not delete the file from your system. They just tell Git to ignore future updates to the file.+
      1. Add the file in your .gitignore.
      2. Run the following:
      > git rm --cached <file>
      3. Commit the removal of the file and the updated .gitignore to your repo.
      

      參考地址:

      1. .gitignore for C#: https://github.com/github/gitignore/blob/master/VisualStudio.gitignore#L28
      2. https://stackoverflow.com/questions/45016619/what-is-the-storage-ide-file-beneath-my-visual-studio-solution-folder-and-wha
      3. https://stackoverflow.com/questions/45802083/visual-studio-2017-15-3-0-git-changes-include-storage-ide-even-though-vs-in
      4. https://docs.microsoft.com/en-us/vsts/git/tutorial/ignore-files?tabs=visual-studio

      Ps2: 加一個描述更詳細(xì)的說明

      參考地址:http://www.pfeng.org/archives/840


      1. 關(guān)于將已經(jīng)ignore的文件(夾)重新加入跟蹤里面

      重新添加已經(jīng)被忽略過的文件(夾)

      重新添加已經(jīng)被忽略過的文件時,我們僅僅使用git add是不行的,因為git倉庫中根本沒有那個文件,這時候我們需要加上-f參數(shù)來強制添加到倉庫中,然后在提交。比如上面設(shè)置了忽略排除的文件TokenGuard.php我們需要重新加入

      git add -f [文件(夾)名]
      

      然后在commit和push就行了


      2. 關(guān)于VS中經(jīng)常出現(xiàn)的error: Your local changes to the following files would be overwritten by merge:

      error: Your local changes to the following files would be overwritten by merge:

      意思是我本地上新修改的代碼的文件,將會被git服務(wù)器上的代碼覆蓋;我當(dāng)然不想剛剛寫的代碼被覆蓋掉,看了git的手冊,發(fā)現(xiàn)可以這樣解決:

      方法1:如果你想保留剛才本地修改的代碼,并把git服務(wù)器上的代碼pull到本地(本地剛才修改的代碼將會被暫時封存起來)

       git stash  
       git pull origin master  
       git stash pop  
      

      如此一來,服務(wù)器上的代碼更新到了本地,而且你本地修改的代碼也沒有被覆蓋,之后使用add,commit,push 命令即可更新本地代碼到服務(wù)器了。

      方法2、如果你想完全地覆蓋本地的代碼,只保留服務(wù)器端代碼,則直接回退到上一個版本,再進行pull:

       git reset --hard  
       git pull origin master  
      
      

      注:其中origin master表示git的主分支。

      posted @ 2017-11-20 10:33  winleechina  閱讀(7562)  評論(1)    收藏  舉報
      主站蜘蛛池模板: 永久免费观看美女裸体的网站| 国产精品中文字幕日韩| 国产人成亚洲第一网站在线播放| 国产成人精品亚洲资源| 香蕉亚洲欧洲在线一区| 丁香婷婷在线视频| 国精偷拍一区二区三区| av亚洲一区二区在线| 99久久激情国产精品| 日本亚洲色大成网站www久久 | 激情综合一区二区三区| 成人精品动漫一区二区| 精品乱码一区二区三四五区| 一区二区三区国产不卡| 人妻一区二区三区三区| 亚洲国产精品综合久久20| 久久国内精品自在自线观看| 人妻聚色窝窝人体WWW一区| 国内精品久久久久电影院| 我国产码在线观看av哈哈哈网站| 国产综合精品一区二区三区| 久久综合伊人77777| 国产成AV人片久青草影院| 蜜桃麻豆www久久囤产精品| 免费无码久久成人网站入口| 亚洲最大日韩精品一区| 浦江县| 国产91色综合久久免费| 国产日韩精品中文字幕| 老色鬼在线精品视频在线观看| 色综合天天综合网中文伊| 国产成人a在线观看视频免费| 国产稚嫩高中生呻吟激情在线视频 | 国产精品免费观看色悠悠| 中文字幕人成乱码熟女| 亚洲一区二区三区人妻天堂 | 欧美特级午夜一区二区三区 | 久久久久久亚洲精品成人| 熟女精品国产一区二区三区| 精品无码一区二区三区爱欲| 久久婷婷综合色丁香五月|