Pasan W.
Pasan W.

Reputation: 714

Git push doesnt upload folders inside main folder

I have the following projects in a folder structure.

I want to submit this whole 'project' to a given repository(which I've already set up). So I first did cd to the Homework directory and did

$git init

Then I did

$git add --all

After that I commited by

$git commit -m "Adding all folders"

Then did the push as

$git push origin master

After this when I opened the repository URL on browser I see only the readme.txt in Homework directory. I don't see the Ex1,Ex2,Ex3 folders and their contents.

What am I doing wrong here?

Upvotes: 2

Views: 2638

Answers (2)

Ayushman Rayaguru
Ayushman Rayaguru

Reputation: 1

Pushing Folder to repository.

Step 1)Make sure you have a repository or create new one to which the folder will be pushed.

Step 2)Now in desktop go to that folder(which is to be uploaded).

Step 3)Now in that folder ; right click "Git Bash here".

Step 4)Type command :

$ git init
$ git add.
$ git config --global user.name <github user_name>
$ git commit -m "first commit"

IV.1)Add remote repository URL(in github account>your repository) to**

$ git remote add origin <paste the URL>

(URL looks like:https://github.com//.git

$ git push origin master

Step 5)Confirm

Step 6)Uploading takes place.Now refresh your repository in github account.

Step 7)Folder is uploaded .

Upvotes: 0

VonC
VonC

Reputation: 1324278

If Ex1, Ex2 and Ex3 have their own .git folder, there would be considered as nested Git repos, and would be ignored by a git add.

If those .git are files, that would make them submodules.

Upvotes: 3

Related Questions