Problem in creating a new local Git repository

13 visualizaciones (últimos 30 días)
Roberto Dima
Roberto Dima el 24 de Oct. de 2020
Editada: Mario Malic el 26 de Oct. de 2020
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 comentarios
Roberto Dima
Roberto Dima el 26 de Oct. de 2020
Surely I will deepen the topic "projects" but I did not mean that. I'm sorry because I don't speak English very well, but I'll try to be more clear: I have an "example" folder with several .m files. There is no .prj file. I would like to create a git repository associated with this folder in Matlab. Unfortunately I don't get the same result as the "git init" command in git Bash, that is to create a .git folder inside "example" where git keeps all its snapshots. What is the right procedure?
Mario Malic
Mario Malic el 26 de Oct. de 2020
Editada: Mario Malic el 26 de Oct. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Source Control Integration en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by