Problem in creating a new local Git repository
Afficher commentaires plus anciens
Hello,
I've just discovered that Matlab 2020b implements a built-in git integration. I tried to create a new repository without success.
As far as I know, when you use the command git init in "A" folder, git will create an hidden .git folder in "A" where all snapshots are stored. So, I opened my project folder in Matlab, right clicked in current empty folder and then clicked on source control -> manage files. When the dialog box opens, I selected:
- "A\.git" as Repository path
- "A" as Sandbox
But I received this errore message: "Destination path "A" already exists and is not an empty directory".
I also tried others configurations:
- "A" as Repository path
- "A" as Sandbox
I'm able to finish the procedure if and only if I choose two not related folders, ie. "B" and "A". In this case, however, I'll find git files both in "B" and in "A\.git" folder which is automatically created.
How could obtain the typical git behaviour?
Thanks
5 commentaires
Mario Malic
le 25 Oct 2020
I would suggest you to add relevant files to project first and then add source control within MATLAB.
Roberto Dima
le 26 Oct 2020
Mario Malic
le 26 Oct 2020
Modifié(e) : Mario Malic
le 26 Oct 2020
In MATLAB, IIRC one project per folder, I am not sure whether it's possible to have another project folder within another project. See link here for some guidance https://uk.mathworks.com/help/matlab/projects.html. There's a Source Control topic as well.
Roberto Dima
le 26 Oct 2020
Mario Malic
le 26 Oct 2020
Modifié(e) : Mario Malic
le 26 Oct 2020
Example: Go to folder with all the files, New - Project - From Folder. After you selected it, from the toolbar click on Source Control, and then select Git and OK. Now you'll have the Source Control Toolbar to do whatever needed.
Hidden folders .git, resources, and .prj file, are not part of project by default.
What is the difference between !git init (MATLAB CMD window) and git init (shell/CMD)?
Edit: Just verified, you can have more projects within folders, but can't have two projects in the same folder.
Réponses (0)
Catégories
En savoir plus sur Source Control dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!