Add a new local directory to the remote git branch

I have a directory on my PC that I would like to add to a specific branch in the remote git repository on my server. I have git, the branch was created fresh from the wizard from the server, but I have a whole project with which I would like to use git.

What is the best way to do this?

+8
git
source share
1 answer

Clone a remote repository on your PC.

git clone user@example.com:myproject.git

Browse the branch where you would like to add these files.

cd myproject

git checkout -b my_new_branch

Move the files to the project directory, then add and copy them.

git add .

git commit -m "new files for my new branch"

You probably want to click too.

git push origin my_new_branch

+11
source share

All Articles