Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
1 view
in DevOps and Agile by (29.3k points)
edited by

I am trying to add a branch to the master branch on GitHub and push a folder onto that branch.

The folder structure of the branch looks like - SocialApp/SourceCode/DevTrunk/SocialApp and all the source code files are in the last folder.

I am using the following Git commands:

git add *

git commit -m with the message

git push

This is pushing only the first folder "SocialApp" onto GitHub and ignoring the folder SourceCode that is inside the folder. How do I fix this?

closed

1 Answer

+2 votes
by (50.2k points)
selected by
 
Best answer

For this case: 

Go to .gitignore file and check whether the subdirectory is ignored or not ignored.

And then you could do:

git add --all

git commit -am "<commit message>"

git push

This will add the entire folder to a repository.

Refer: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---amend

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...