Need VSCode help!

I just started trying to use VSCode today and am starting to become very frustrated with it. For me, it is not nearly as intuitive as eclipse was and I can’t find any useful tutorials online. More specifically, currently I am trying to clone my existing github repositories into VSCode and cannot figure it out. I can’t figure out if there is a preinstalled git window like I’ve seen in a couple tutorials or like eclispe had, and when I’ve tried to run the git: clone command and given it a url it asks me to find the repository location in my computer, but when I give it the location, it gives me this error: image

I have no idea what I’m doing and currently really miss eclipse, any help is greatly appreciated.

1 Like

According to This StackOverflow question it’s probably a path/git setup issue on your machine. I would try some of the suggestions there first.

Also, it won’t work to clone an older (pre 2019) robot project into vscode to use it directly; the project setup is very different than Eclipse and while old projects can be imported, they cannot be upgraded in place.

1 Like

I’ve just tended to drop to command line (regular or PowerShell) and issue a git clone, then open that folder in VS Code. But, I did just test git: clone from within VS Code and it worked for me. Does git clone work from the command line? You could also try from the Terminal within VS Code (i.e. PowerShell) if you want to visually stay within the IDE. Like Peter suggests, you might check your git setup.

1 Like

I think my problem is that I can’t find a proper git.exe file on my system, I know I have to configure git in my path variable and VSCode stopped giving me errors when I used this path:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd,
but I’m pretty sure that this isn’t right if it’s not working right now.

1 Like

I would recommend installing Git directly from its distribution instead. https://www.git-scm.com/downloads

2 Likes

Are you using GitHub? If so, in addition to downloading Git from https://www.git-scm.com/downloads as @Peter_Johnson noted, download GitHub Desktop from https://desktop.github.com.

1 Like

So I downloaded git directly, found the git.exe file in the same location as in the StackOverflow answer, added that path to my path variable, and I’m still getting the same error.

1 Like

I downloaded GitHub Desktop and it can’t find VSCode as an external editor

1 Like

Questions:

  • Can you check to see if there are other locations in your path variable that might point to other Git installations?
  • Where is your repository stored? Is it public or private (which will require authentication)?
  • Can you clone a test repo via the command line. For example run git clone https://github.com/getsentry/test-repo.git in Command Prompt or Powershell.
  • If the command above works, can you run git clone <YOUR-REPO-HERE> ?
1 Like

As far as I can tell that is the only place in my path variable that points to a git installation. The repo is public. I tried the clone the test repo in Powershell and it still came back with git: ‘remote-https’ is not a git command. See ‘git --help’.

1 Like

You should be able to configure VS Code to point to a Git path if it is having difficulty finding it for some reason. Pressing Ctrl-, should open the settings menu, and type “Git” and see what pops up. I’m pretty sure there’s a setting to set the path to the executable in there.

So I found this setting:
image

And I tried to add this to the User Settings Tab:
image

And that didn’t quite seem to work, unless I’m not saving it properly.

Edit: Never mind, I think I actually got git working and didn’t realize it, I was successfully able to clone a repository, I’m not entirely sure how to access it now, but I think git is at least working. Still wondering about Github Desktop, can’t seem to integrate it with VSCode, but it seems like it’d be helpful.

+1000 on use the git CLI. It’s the same everywhere. Also good to bear in mind you don’t actually know what decisions the ide is making for you without doing some digging. Git CLI is face value.

1 Like

–This… I know getting git set up is a challenge that needs to be addressed, but if the current version of Gradle is anything like the one in Android Studio, reusing an entire project directly will lead to headaches.

I recommend using Git Bash since it provides most of the same commands that you can run on *nix devices. Powershell has a couple commands, but Git Bash makes the process of using git equal on all git-supported operating systems.