Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When I commit a project an extra project dir is created

I commit a project on github using these steps :

Right click your project, select Team -> Share Project -> Git. Select the proposed line and press "Create repository". Press finish.

Right-mouse click on your project and select "Team" -> "Push". A dialog pops up. Maintain the following data. Adjust the hightlighted line so that you are using your user and your project name.

But when I view my project on github this is my project structure : myproject -> myproject -> src

When it should be : myproject -> src

So an extra level with the project name is being created on github. Am I commiting the project correctly ?

When I try to share the project with "Use or create repository in parent folder of project" enabled the project path is "c:\homedir\git\egit-test1\egit-test1" Should it not be "c:\homedir\git\egit-test1\" ?

Screenshot attached : enter image description here

like image 403
blue-sky Avatar asked Sep 17 '12 15:09

blue-sky


People also ask

How do I commit to an existing repository?

To add and commit files to a Git repository Create your new files or edit existing files in your local project directory. Enter git add --all at the command line prompt in your local project directory to add the files or changes to the repository. Enter git status to see the changes to be committed.

What is project repository in Git?

A Git repository tracks and saves the history of all changes made to the files in a Git project. It saves this data in a directory called . git , also known as the repository folder. Git uses a version control system to track all changes made to the project and save them in the repository.


1 Answers

If you don't want the additional directory level in your git repository, you need to enable the "Use or create repository in parent folder of project" option at the very top of the "Configure Git Repository" dialog (Team -> Share Project... -> Git).

However, this will create the repository directly in your workspace and not in the default repository folder, which is not recommended. But you can move the project to the right place and re-import it into your workspace in a second step.

create repository in parent folder of project

Another option would be to create the repository on github first. Afterwards you can clone the github repository and move your code into it.

like image 170
Stefan Ferstl Avatar answered Oct 12 '22 15:10

Stefan Ferstl