2014-09-26 101 views
14

當我第一次添加一個項目到源代碼管理(GIT)時,它會顯示所有的文件,一切都會很好。我可以繼續工作大約30分鐘至1小時,並顯示所有更改(任何文件我進行更改)。Visual Studio:Git團隊資源管理器不顯示任何更改

但經過一段時間後,它顯示無論我做了多少更改,都不編輯任何文件。我只是沒有得到它...我看着.gitignore文件,我沒有看到任何我正在使用的文件類型,所以我沒有得到什麼。

我正在處理一個多層MVC應用程序,所以很多C#,一堆.cshtml等等。

小貼士?谷歌沒有找到任何東西。這裏是.gitignore文件... 我得到了這個傢伙一樣的問題......他沒有回答!

When I save a file with changes, its status automatically goes back to unchanged/committed (blue lock)

## Ignore Visual Studio temporary files, build results, and 
## files generated by popular Visual Studio add-ons. 

# User-specific files 
*.suo 
*.user 
*.sln.docstates 

# Build results 

[Dd]ebug/ 
[Rr]elease/ 
x64/ 
build/ 
[Bb]in/ 
[Oo]bj/ 

# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 
!packages/*/build/ 

# MSTest test Results 
[Tt]est[Rr]esult*/ 
[Bb]uild[Ll]og.* 

*_i.c 
*_p.c 
*.ilk 
*.meta 
*.obj 
*.pch 
*.pdb 
*.pgc 
*.pgd 
*.rsp 
*.sbr 
*.tlb 
*.tli 
*.tlh 
*.tmp 
*.tmp_proj 
*.log 
*.vspscc 
*.vssscc 
.builds 
*.pidb 
*.log 
*.scc 

# Visual C++ cache files 
ipch/ 
*.aps 
*.ncb 
*.opensdf 
*.sdf 
*.cachefile 

# Visual Studio profiler 
*.psess 
*.vsp 
*.vspx 

# Guidance Automation Toolkit 
*.gpState 

# ReSharper is a .NET coding add-in 
_ReSharper*/ 
*.[Rr]e[Ss]harper 

# TeamCity is a build add-in 
_TeamCity* 

# DotCover is a Code Coverage Tool 
*.dotCover 

# NCrunch 
*.ncrunch* 
.*crunch*.local.xml 

# Installshield output folder 
[Ee]xpress/ 

# DocProject is a documentation generator add-in 
DocProject/buildhelp/ 
DocProject/Help/*.HxT 
DocProject/Help/*.HxC 
DocProject/Help/*.hhc 
DocProject/Help/*.hhk 
DocProject/Help/*.hhp 
DocProject/Help/Html2 
DocProject/Help/html 

# Click-Once directory 
publish/ 

# Publish Web Output 
*.Publish.xml 

# NuGet Packages Directory 
## TODO: If you have NuGet Package Restore enabled, uncomment the next line 
#packages/ 

# Windows Azure Build Output 
csx 
*.build.csdef 

# Windows Store app package directory 
AppPackages/ 

# Others 
vsql/ 
*.Cache 
ClientBin/ 
[Ss]tyle[Cc]op.* 
~$* 
*~ 
*.dbmdl 
*.[Pp]ublish.xml 
*.pfx 
*.publishsettings 

# RIA/Silverlight projects 
Generated_Code/ 

# Backup & report files from converting an old project file to a newer 
# Visual Studio version. Backup files are not needed, because we have git ;-) 
_UpgradeReport_Files/ 
Backup*/ 
UpgradeLog*.XML 
UpgradeLog*.htm 

# SQL Server files 
App_Data/*.mdf 
App_Data/*.ldf 


#LightSwitch generated files 
GeneratedArtifacts/ 
_Pvt_Extensions/ 
ModelManifest.xml 

# ========================= 
# Windows detritus 
# ========================= 

# Windows image file caches 
Thumbs.db 
ehthumbs.db 

# Folder config file 
Desktop.ini 

# Recycle Bin used on file shares 
$RECYCLE.BIN/ 

# Mac desktop service store files 
.DS_Store 

回答

8

重新啓動我的機器修好了我。重新啓動Visual Studio是不夠的,但在重新啓動整個系統後,現在在團隊資源管理器中顯示更改。

+0

將調查此感謝人 – Spets 2015-02-09 04:21:25

+1

同樣的問題,我重新啓動,並出現變化。直到現在我還沒有看到過,希望不會再次。 – Steve 2015-02-13 23:37:18

3

對我來說重新啓動是沒有必要的。只需關閉並重新打開解決方案即可。只要該技巧無效,重新啓動Visual Studio就行。

與Eclipse IDE不同,Visual Studio不提供Restart菜單項。我需要install an Extension來做到這一點。

14

我發現VS正在打開一個.opendb文件,在搜索更改時導致權限衝突。它在「源代碼管理 - Git」下報告了輸出窗口中導致問題的確切文件。將此添加到我的.gitignore修復了這個問題。如果VS重新啓動或重新啓動修復了問題,那麼您可能會關閉有問題的文件句柄 - 在我的情況下VS每次都打開問題文件。

另請參閱Visual Studio TFS Git not seeing any changes以瞭解更多潛在原因。

1

對於它的價值,我不必重新啓動VS2015或我的機器即可讓我的更改顯示出來。我只是從源代碼管理中斷開連接,然後重新連接,然後它看到了更改。

0

如果您使用的是Git擴展,請重新安裝並重新啓動Visual Studio 2015,它解決了我的問題。

4

我的Visual Studio「源代碼控制 - Git」日誌不斷抱怨從我的SQL項目鎖定的文件。一個.jfm文件。將它添加到.gitignore,然後工作。

所以,當你的解決方案顯示沒有改變時,無論你改變什麼,都要檢查你的Git日誌。

0

確保您的文件未加密。我正在使用Windows工作文件夾,並且新文件被加密。 VS中的Git無法看到它們。

0

不幸的是,以上都不是爲我工作,但一段時間後,這是我的解決方案:

  1. 找到你.git文件夾存儲庫。
  2. 找到並刪除裏面的'index.lock'文件。
  3. 重新啓動Visual Studio。

我正在使用Visual Studio 2017,但我希望這有助於某人!

+0

請不要在多個問題上發佈相同的答案。發佈一個很好的答案,然後投票/標記以重複關閉其他問題。如果問題不重複,*定製您的問題答案。* – 2017-07-17 20:37:19

+0

@PaulRoub感謝您的提示!你如何將重複的其他問題關閉? – 2017-07-17 20:45:26

+1

使用問題下方的「標記」鏈接。請參閱[如何處理重複問題](https://meta.stackexchange.com/questions/10841/how-should-duplicate-questions-be-handled/)和[地球上的「標記重複」UI ?](https://meta.stackexchange.com/questions/118124/where-on-earth-is-the-mark-duplicate-ui) – 2017-07-17 20:50:09

相關問題