Aditya J Gupta Aditya J Gupta - 3 months ago 29
Git Question

How to clone a folder on a PC on Github

I'm new to git. I'm finding it hard to figure out how (if possible) can I copy a folder (along with its sub-folders) over to a git repository either using the bash or the web interface while maintaining the folder structure


First you should clone your repository to xxx-subfolder:

git clone <repository-URL> xxx

Now you copy your folder to xxx folder.

Add the folder to git repository:

git add .

Commit the change:

git commit -m "New folder is added"

Push the change to remote git server:

git push