IT TIP

Visual Studio TFS Git에서 변경 사항이 표시되지 않음

itqueen 2020. 12. 8. 20:32
반응형

Visual Studio TFS Git에서 변경 사항이 표시되지 않음


Visual Studio의 TFS 용 Git에 대해 뭔가를 얻지 못했습니다.

TFS의 Git에서 동료의 솔루션을 복제하고 코드를 추가하기 시작했습니다. 그런 다음 변경 사항에 대해 자체 분기가 필요하다는 것을 깨달았으므로 새 로컬 분기를 원격 Git 저장소푸시하고 추적 의 지침에 따라 실행했습니다.

git checkout -b e4ctim
git push -u origin e4ctim

코드를 변경하면 Visual Studio에 코드 파일 옆에 익숙한 빨간색 체크 표시 아이콘이 표시되어 변경으로 인해 파일이 체크 아웃되었음을 안심시킬 수 있습니다.

VS 레드 틱

그런 다음 파일을 저장하면 Visual Studio가 아이콘을 파란색 자물쇠로 되돌립니다. 빨간색 눈금에서 파란색 자물쇠로의 변경은 변경 사항이 Git에서 로컬로 체크인되었음을 의미한다고 가정합니다.

VS 블루 락

하지만 수정 된 파일의 이력을 보면 아무것도 없습니다!

역사 없음

변경 사항을 로컬로 커밋하고 TFS 서버와 동기화하고 싶습니다.

Visual Studio에는 변경 사항이 전혀 표시되지 않습니다.

VS TFS 변경 사항

명령 줄에서 Git이 명령을 실행하여 모든 수정 사항을 감지했음을 알 수 있습니다.

git status

커밋 및 추적되지 않은 파일에 대해 준비되지 않은 많은 변경 사항을 확인합니다.

자식 상태 cmd

내가 사용할 수 있는 Git 책을 느슨하게

git add

또는 더 구체적으로

git add -u .

커밋 할 준비가 된 파일을 준비하지만 Git 리포지토리 (추적, 커밋)에서 앱 개발 Visual Studio 설명서에 나와 있으므로 그렇게하는 것을 꺼려합니다 .

Q : Git 스테이지는 어디에 있습니까?
A : 숙련 된 Git 사용자라면 Visual Studio가 명령 프롬프트와 다르게 변경 사항을 처리한다는 사실을 알 수 있습니다. 포함 된 변경 사항 섹션에 단계적 변경 사항이 포함되어 있는지 궁금 할 수 있습니다. 실제로 Visual Studio는 일반적으로 Git 단계를 우회합니다. 변경 사항을 커밋하면 Visual Studio에서 동시에 스테이징하고 커밋합니다. 한 가지 예외는 Git 저장소에 파일을 추가 할 때 발생합니다. Visual Studio는 이러한 종류의 변경을 준비합니다.

Visual Studio는 변경 사항을 동시에 스테이징하고 커밋합니다. 그러나 추적 된 파일에 대한 수정 사항을 변경 사항으로 나열하지 않고 커밋 할 수있는 이유는 무엇입니까?


이것은 설명보다는 해결 방법에 가깝지만 "변경 사항을 커밋 할 때 Visual Studio가 동시에 스테이징하고 커밋" 하는 설명서를 무시 하고 대신 명령을 사용하여 스테이징에 수정 사항을 추가 했음을 발견했습니다.

git add -u .

그런 다음 Visual Studio가 갑자기 수정 사항을 인식하고 로컬로 커밋하고 TFS 서버와 동기화하도록했습니다. 또한 내가 추가 한 파일에 '새 파일'녹색 십자가를 표시하고 다른 커밋을 수행 한 다음 다른 동기화를 수행하여 내가 만든 추가 및 삭제를 선택할 수 있음을 발견했습니다.

그 이후로 Visual Studio는 내가 예상하는대로 수행합니다. 파일을 변경하면 파일이 커밋 창에 변경된 것으로 나열됩니다.

Visual Studio가 초기까지 변경 사항을 선택하지 못한 이유는 아직 모르겠지만 git add적어도 지금은 작동합니다.


이 줄을 .gitignore에 추가해야했습니다.

[path to project]/node_modules/

분명히 VS2015는 거기에서 매우 긴 경로에서 충돌하고 모든 희망을 포기하기로 결정했습니다.


myProject\.git\index.lock내 경우 에는 파일을 삭제하십시오 .


나는 동일한 프로브를 가지고 있었고 다음을 깨달았습니다. 변경 세트를 표시하기 위해 @dumbledad가 말했듯이 Visual Studio는 명령을 실행합니다.

git add -u 

내부적으로 업데이트를 준비합니다. 변경 집합에 추가하려는 파일 중 일부가 다른 프로세스에 의해 열려있는 경우 git 명령에 권한 오류가 발생합니다. 그리고 Visual Studio는 변경 사항을 표시하지 않습니다.

In my case, I had a document in my repo that was open by another application, and that caused Visual Studio not to show the modifications because of the Git permission error. So check if any of the files of your git repository is not open by any other application.


I'm using VS 2015 Update 1 and also meet this problem. Furthermore, at the same time, the VS' output window told me my VC.opendb file under the solution folder is occupied by another program. According to this, I fixed the issue of occupying: add *.VC.opendb and *.VC.db to the .gitignore file. Then everything goes well.


I was having the same issue with Visual Studio Update 3. VS was saving locally but not picking up any changes so I couldn't commit.

I downloaded Git for Windows from https://git-for-windows.github.io/ (thanks @fhilton), opened the Developer Command Prompt and changed directory to C:\Repos\Scheduler (the location of my source code).

I then ran GET ADD -U and received the following error...

error: open("WindowsServices\Scheduler.WindowServices.InstallLog"): Permission Denied

error: unable to index file WindowsServices\Scheduler.WindowServices.InstallLog

fatal: updating files failed

As others have said, it looks like the GIT tools in Visual Studio can fail silently, even for the most basic Windows level errors. Worse, it can tell you GIT is fully in sync. Command line is certainly your friend for the time being.


I had this problem on a new machine with a fresh install of both VS2013 Update 5 and VS 2015 and it was driving me crazy. Then I found if I installed Git for Windows, the problem went away! https://git-for-windows.github.io/


Then i was trying to make changes but files doesn't get effected...There is a easy solution for this. The major problem is one of your git ignore files ignoring your files..

Open your local repo for instance D://repos, then look file you want

--> D://repos/project1/HomeViewModel.cs

--> Right click on it and click on Git Extentions

--> Choose +Add Files

여기에 이미지 설명 입력

--> then Force option

여기에 이미지 설명 입력

--> Click on Addfiles..Here you go you file will be added in changes


Helpful article! Using Git Bash (git add -u) helped me get closer to the cause of the problem. After committing changes previously not shown in Visual Studio, only half-way commit was done because of using a SQL Server Database Project; Apparently, Windows 10 started to add jfm-files in the same folder keeping it open all the time and preventing it from beeing accessed by VS. Solution was to add it to the .gitignore before committing.

See this thread for further information:

Visual Studio 2015 Database Project directory contains a file with extension jfm


Open View > Output, select 'Source Control - Git' in Show Output from and check for any errors. As others mentioned, any error in Git makes MS Project silently ignore any changes.

참고 URL : https://stackoverflow.com/questions/28454746/visual-studio-tfs-git-not-seeing-any-changes

반응형