Terminal Git Status showing different than Visual Studio status - github

I've been at this for a couple of days and I can't figure this out.
When I run git status on my terminal, it's giving me a different result than what my visual studio 2022 shows me. I think this all started when i added git lfs to my repo using brew so it doesnt track the larger files i have.
For example, in my terminal, it's showing: . Usually they show the same files always and never have an issue.
but then on the same branch in visual studio 2022, it's showing, it's showing this:
so far, I've tried:
Restarting my computer and visual studio(I had to try)
Using the sync button (next to the pushbutton) in visual studio.
Running git remote update on my terminal
I can't find anything else on SO to try.
Any and all help or direction is appreciated!

Check your .gitattributes files; since you added git lfs, it tracks the large file extensions with the .gitattributes file. That may be the reason why Visual Studio is not tracking those files, but your git terminal does.

There is a bug which i also face in visual studio.
Sometimes the VSCode cannot track the files which are updated.
what you can try is update the visual studio to see if the bug is fixed or not.
Mine was resolved by updating the VS.
PS: try using GitLens for a broader view of git.

Related

VSCode issue after removing GitHub- Cant access old folder directories

I tried installing GitHub on Visual Studio Code, but eventually decided to not use it. After I removed the GitHub extensions, I am no longer able to open or save files in the same manner. When I go to open a file or save one, I no longer am directed to the old folder directory from before.
A message now appears in the bottom right hand corner that says "File system provider for vscode-vfs://github/exercise-1-/Untitled-2.ipynb is not available."
I'm trying to get VSCode to return back to the way it was prior to installing GitHub. Any ideas what may be causing this?
Seems I just needed to click the icon in the bottom left with a head on it (accounts) and log out of my GitHub account. Then close Visual Studio entirely and reopen. Everything seems to be running as it did prior to the GitHub installation.

Visual Studio Code source control not showing changes

Visual Studio Code source control panel is empty when I click on it. Nothing to expand and nothing to click on.
Things I've tried:
Uninstalled/Reinstalled Git
Uninstall/Reinstalled VS Code
Removed extensions folder
Open your project with cmd.
> cd your-folder-location
> code . -n
It worked for me
Dude, just lost an hour because my SCM in VSCode randomly stopped showing anything today. I restarted everything, tried git init, everything on the forums. Made sure Git built in extension is enabled, mine was already enabled so I was totally lost.
All I had to do was disable and then reenable the built in Git extension. and it fixed it.
Go to Extensions.
Filter by "built in".
Click the gear icon by Git, and click disable.
Then click it again, and click enable.
Here is a screenshot reference
In my case, somehow, the Source Control Repositories option, available under the 3 dots ... on the SOURCE CONTROL tab, was no longer selected.
All I had to do was press the ... and select Source Control Repositories, then select the correct repo, and all the changes were again listed.
I had a similar issue. It seems vs code has two source control extensions. When I clicked View -> SCM it opened an extension with changes displaying.
source control extension 1
source control extension 2
I had this problem 2-3 times for the last 2 years (OS -> Linux Mint). The changes on any file didn't appear to the source control nor have they been marked on the line I've edited. When manually go to "Source control" and click on the refresh button they appear but the lines that I had change didn't light up (there were no visual marking on the files after editing them). This happened when I switched to a different branch while the workspace was open to the 2 monitors at the same time. Or when working on several projects (opened 2-3 or more VS Code instances). The scariest thing was that it didn't work not only for one repository(project) but for all of them. I've read alot on the subject and tried everything that I found and think of. There is some issue with git path mapping or something.
The thing that I tried:
reload VS Code
restarting VS Code
disable all extensions
enable/disable all git related options in (file -> preferences -> settings)
deleting (folders and files) and cloning the repository
updating git
removing and installing git
restarting PC (don't judge me I was desperate)
But the only solution that worked for me was:
open VS Code (if open, don't close it)
go to the directory where you keep your repositories (not from VS Code but from you file explorer).
go one folder above it (if you are in .../{{some folder}}/{{you repos}}, go to ../{{some folder}})
then open you repositories containing folder (/{{you repos}}) by right click -> open with VS Code
wait until everything loads. The Source Control will mark alot of changes, don't worry about it.
then close VS Code (all windows (instances), because it will open a new instance)
after that go to the directory where you keep your repositories again and right click and open with VS code the repository of you choice. Now at this point the Source control will start working properly.
What worked for me was going to my "code" folder where I keep all my repos, right-clicking on the folder containing the repo I want and opening that folder with VS Code.
The VS Code window for this specific repo was closed. I did have another window for a different repo open. As soon as the window opened, the changes showed up in source control and I was able to commit, push and everything else like normal.
I faced this problem when I opened a repo in a directory inside symlink.
My solution: just open this directory in original destination without any symlinks
I had this problem in a repository not as a problem from config but because I had a coverage folder with thousands of files not tracked and it seemed to slow the process of checking that out too much.
So I added that folder to .gitignore and it started working again.
Restating my Vscode And Giving time to load properly Solved my Problem
I had the same problem. What I did was:
Open another folder with File -> Open Folder...
Close the VSC
Open VSC
Open the original folder with File -> Open Folder...
After this I saw that the source control started loading and my changes came back.
Hope this works for you.
I couldn't see any changes in while trying git status. I opened changed files in text editor and they were not changed either. That lead me to conclusion that changes can't be seen by the system (and therefore by git).
The Autosave option was disabled, simply saving the changes helped.
That was my beginning with VSC, in Pycharm never had such problem.
I had this problem, because I was changing files one folder down from where I opened Visual Studio Code.
Solution- open Visual Studio Code without a location, File/Open Folder - open the folder I am directly working out of.
Unstaged changes now show in the direct folder I'm working in. Unstage changes previously auto-staged by Visual Studio Code when working on a nested project directory to see them (open a Terminal and run git reset).
I encountered the same issue, and I fixed that by removing the files.watcherExclude property in settings.json file.
Because the value of files.watcherExclude became { "**/**/*": true } somehow.
// settings.json
// remove or comment next line
// files.watcherExclude: { "**/**/*": true }
For me, the files were in WSL (Windows subsystem for linux) but I was not opening the folder as such.
in the bottom left, click the green >< symbol, then click "reopen folder in WSL"
VSC remote mode image
presto.
Go to View -> Terminal
cd to root folder, and run git status and see if you have any errors
I had a unsafe repository fatat error, as my repo was on a network drive. Did as suggested by git to add an exception and it fixed the issue.
close vscode
moved local Code config folder as backup (~/.config/Code/)
reopen vscode (this will still show problem)
close and reopen vscode (this will show db re-write issue but it will re-create config folder.)
this solved my problem. this reset many of my settings but It can be checked from config backup.
In setting check Git: Autorefresh
I experience this problem when I right click a folder and open it up with VS code. Instead now I start VS code from the start menu and after that I use File -> Open Folder option.
I experienced this issue with VSCode V1.70.1, all I did is just closing VSCode completely and open a new instance and I could find git changes appears simultaneously as expected.
If running into this issue on a Mac, make sure you are running your instance of Visual Studio Code from your Applications folder and not your Downloads folder. I managed to fire up an instance from the wrong folder and this prevented my Source Control from being able to properly load git info and also caused Visual Studio updates to fail. More on the issue can be found here.
Here is another possible solution for Linux users:
In my case, it was only not showing lines changed with the file open. Source control tab was showing fine.
I have a symlink from /var/www to /mnt/{hdd-uuid}/www. When I created my workspace, it was using the path /var/www/project-folder, instead of the full path, and this was giving me the error.
I opened my .code-workpsace file in another text editor and changed the references in the JSON from ../../../../var/www/project-folder to /mnt/{hdd-uuid}/www/project-folder, then reopen VS Code. Close all file tabs open and, when you open again a modified file it will show the lines changed.
It is possible that you need to trust the repo again.
Try opening project or folder which contains git files. Later try opening your wanted folder. This sorted the issue for me.
Double-check git is actually installed on your system. I just did a fresh install of Windows 11 the other day, and although one of the development tools I installed thereafter downloaded and supposedly installed git in Windows, actually, it never installed it. Fail!
I fixed this issue by toggled-on the AutoSave feature in VSCode via File > AutoSave. I noticed that the badge on the github does not show up until the file is actually saved first.
What worked for me was that I was forgetting to save, so just enabled autosave option.
File > Auto Save (check)
Open Visual Studio code -> View -> Appearance -> Show activity bar

Show git branch in Visual Studio Code

I have a project folder structure like this : Code/Repo/<repo_folder_name>/..subfolders and in the <repo_folder_name> i have the hidden .git folder because i cloned from Sourcetree to this folder .
Eclipse does show the current branch , but when i open this folder in Visual Studio Code , i know it must show the current branch name , in the bottom left side .
Does anybody know how to do this ? To show the branch name in Visual Studio Code ?
Thank you very much.
-- > I added Sourcetree`s bin folder to the PATH and now everything is working ok :D . Sourcetree uses embed git so you have to add it to the window path
Assuming you have git installed all you do is go to View->Show Status Bar (as seen below). It will then show your current branch on the bottom of your current editor window.
For windows:
The easiest thing would be to change your integrated terminal shell from Powershell to Git Bash. You can do that by going to File > Preferences > Setting and changing the integrated terminal shell, as illustrated below:
For mac navigate to:
Code> Preferences> settings> Search for 'terminal'
In the docs it says:
Note: VS Code will leverage your machine's Git installation, so you
need to install Git first before you get these features. Make sure you
install at least version 2.0.0.
So there needs to be a Git on your system to get it working. Using the embedded Git from your Sourcetree installation will probably work, but might not be the cleanest solution. The Git in my Sourcetree installation (on a Mac) is about 3 years old (2.2.1). On a Mac there is also a Git preinstalled though (2.11.0), so here it works out of the box.
It's not clear if you're looking for display on the command-line [prompt] or in the VSCode UI.
There's this alternative view provided by the sidebar plugin that fits the bill when the Source Control Repositories option is checked (right-click on the topmost Source Control header):
UI branch controls!
In year 2022
From top menu, select and check View > Appearance > Status bar
Status bar appears at bottom of VS Code Window
Branch displays in Status bar on left-side
If you would also like to show the working branch in the Visual code Terminal Window, Try installing posh-git from chocolatey, you get all the git summarycolor codings and tab completion with the branch name in highlighted colors. If you are running a Powershell version less than 6, make sure to set execution policies above Restricted.

Highlight changed files in file tree within visual studio code

The Atom editor highlights changed files when they are inside a Git repo like:
In visual studio code however I am unable to get the same behaviour. Does someone know if this is possible?
Update October 24, 2017
It turns out the insider version of Visual Studio code now contains git status color in the file tree. The insiders version is available at https://code.visualstudio.com/insiders/
It is not implemented yet. But the user #karabaja4 made a HACK and posted it in the issue.
here is the HACK and his comment
I wrote a gulp task that should simplify the installation of the hack (VS Code 1.15 only).
git clone https://github.com/karabaja4/vscode-explorer-git-status.git
cd vscode-explorer-git-status
npm install
gulp install # as root/administrator
P.S. Not tested on all platforms yet, would appreciate if someone would try it on OSX.
https://github.com/Microsoft/vscode/issues/178#issuecomment-322045333

how to build neovim with visual statio2013

this is the project home
https://github.com/neovim/neovim
i'm try to use cmake to build it,but failed .
Do you have any success,tell me the detail way.
thank you!
At the moment the master branch of Neovim does not build in Windows.
There is an issue for Windows support#1749 with an open pull request#810. However the terminal support in that branch is currently broken.
In that first link you can find some instructions on how to build, and a list of issues that still need fixing for Windows support.