How to add my current project to an already existing GitHub repository

Vor picture Vor · Jun 3, 2013 · Viewed 91.7k times · Source

I'm very new to Git. I've been searching for an answer, but I couldn't find one.

In my computer I have a project folder like this:

project_a
--some_folder
--another_folder
--.git

And I have a repository on GitHub, let’s say https://github.com/company/our_repo.git. Under this repository I have some folders. So my goal is to put my project_a under trunk/bin. How do I achieve this? (Again, I'm very very very new.)

Answer

Ziyaddin Sadigov picture Ziyaddin Sadigov · Jun 3, 2013

Open your Terminal, access to this folder and write:

git init
git add .
git commit -m "my commit"
git remote set-url origin [email protected]:username/repo.git
git push origin master