Git repos for eclipse project imported into VS Code

Hi all,

Our team stores previous years’ java code on github, and used eclipse up until this year. We’ve found out how to import the eclipse project into VS code using that WPILib wizard. The problem is that it makes a copy of the eclipse project in a different folder, and this project is no longer a git repo. Has anyone figured out a way to re-associate this new folder with the old repository? So far we have just been initializing a new repository and pushing to that, which isn’t ideal…

Thanks

You could copy over the .git folder if you really want it to be the same repo. I don’t know if I can recommend it though, since it’s kind of a hacky solution.

yeah that’s pretty much what I felt about that idea lol… I mean if it works, i guess? I want there to be a git command to do this (similar to when someone downloads the repo as a .zip folder and then asks me how to push it back, lol) but it’s possible that one doesn’t exist.

are you thinking of git rebase? You still need to specify a remote and pull.

Still, the best solution is to either go to the original directory, delete everything (except .git) and place the vscode code, or copy the .git to the new directory.

yeah we ended up just copying over the .git folder and adding everything. I think the VS code import wizard changes up file structure so it looked like it deleted and re-added everything, but honestly at this point i’m just happy that it’s all together in one spot.

Yea, we just have it as a new repository

A new repository is our recommendation for wpilib as well. With how big of a change it is, holding a repo from year to year isnt recommended.

In fact, we recommend using new repos every year. They’re easy to create and it ensures you don’t lose any old code. It’s really easy to copy code from an old project to a new one, so there’s no reason to not do that.

In addition, with more settings being stored in the projects, year to year updates are likely not going to be supported by wpilib. We will have an old project importer, just like the eclipse one this year, but it will always create a new project in a new location.

2 Likes

We do make a new repo and start with a fresh template for each year’s competition robot.

We also maintain modified code for a handful of previous robots for outreach purposes, and thus far it’s been easiest to keep them up to date so that we can make changes to suit the outreach venue / audience.

Today, the issue was with our “mini test bot” that has an associated git repo that acts more as a sandbox and easy way to record and transfer recent experimentation amongst several laptops.

In these cases, it feels a bit excessive to make a bunch of new repositories, but maybe that’s just me :woman_shrugging:t2:

I meant that we made a new repo for our old years. 2018 and 2018_VsCode for example

Well, that’s definitely a way to do it. I think right now we’re half and half lol. I’m also scrolling through our old repos and it’s really all over the place… I forgot how one year they tried to store CAD files on GitHub, it was awful :joy:

Honestly at this point I think only time will tell for what method this batch of kids wants to stick with.