Go Down

Topic: what do y'all use for version control? (Read 1 time) previous topic - next topic

Delta_G

#30
Jan 12, 2019, 11:56 pm Last Edit: Jan 13, 2019, 12:05 am by Delta_G
To import a project back into Eclipse from Github


First I go to create a new arduino sketch like normal and give it the name I want.  Then I right click and do Team -> Share Project.  This takes you to a dialog to create a repo.  Create an empty repo.  I do it in the parent folder though it says not recommended but I do it so I can delete it with the project later.  It's the one on github that matters to me. 



Now I open up the .h and .cpp files and go to the Git Staging view.  If you don't make an initial commit of these files you'll get an error later that you can't get out of.  Right click and ignore everything but the .h and .cpp files and then move those two to Staged Changes. 





And





Now right click the project in the Explorer and Team -> Remote -> Fetch From   Put in the URI of the repo and everything and click Next.






Pick a ref (master was the only branch I have here) and click "Add All Branches Spec" to add all the branches.  Finish








And   OK








Now in in the repositories view we can see the c3c3357 Working commit from github in the Remote Tracking branches.













Double click it and check it out as a new local branch. 





And





And now you have the project in the "remote" branch of your local repo.  It might have errors because you need to import the libraries it uses into the new project. 





Sometimes it throws weird errors and you have to delete them and hit compile to make it go away, but it's really just that easy. 


Now make changes and commit and push back to the library.












Be sure to set it back to the master branch for the github repo



























|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

jimLee

A separate repository for each sketch and each library.
69 sketch folders and 19 libraries.. 88 repositories?!? Yikes!

-jim lee
PNW Ardiuno & Maker club
1012 9Th Street, Anacortes, WA 98221 (Around the back of building)

pert

Wow, you've been busy! I see no problem in having lots of repositories. It's not as if you're getting charged for each one.

bperrybap

69 sketch folders and 19 libraries.. 88 repositories?!? Yikes!

-jim lee
If some of the sketches are part of the same project you can put each of them in sub directories under a common project tree.
The project gets a repo vs having to have a separate repo for every single sketch.
I do this for many of my projects.

i.e. project is foo and foo has a repository
Under the foo directory you have:

foo/bar/bar.ino
foo/bar1/bar1.ino
foo/bar2/bar2.ino

etc...

--- bill

bperrybap

And if some of the sketches are examples for a library then they will be part of the library repository and should not have their own repository.
--- bill

jimLee

#35
Jan 13, 2019, 07:14 am Last Edit: Jan 13, 2019, 07:35 am by jimLee
No.. The examples are in with the libraries as they should be.

Maybe I could do a folder of doodling sketches then let the bigger sketches have their own folders. I didn't know they could be nested.

-jim lee
PNW Ardiuno & Maker club
1012 9Th Street, Anacortes, WA 98221 (Around the back of building)

Go Up