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:
I have no idea what I’m doing and currently really miss eclipse, any help is greatly appreciated.
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.
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.
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.
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.
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’.
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.
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.
–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.