Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recursively add the entire folder to a repository

Tags:

git

github

People also ask

How do I add all files to my repository?

To add and commit files to a Git repository Create your new files or edit existing files in your local project directory. Enter git add --all at the command line prompt in your local project directory to add the files or changes to the repository. Enter git status to see the changes to be committed.


Check the .gitignore file, if the subdirectory is ignored.

Then try again

git add --all
git commit -am "<commit message>"
git push

SETUP

  • local repository at a local server
  • client is connected to the local server via LAN

UPDATE(Sep 2020): use foldername/\* instead of foldername/\\*:

git add foldername/\*

To make it to the server...

git commit -m "comments..."
git push remote_server_name master

Mostly, users will assign remote_server_name as origin...

git remote add remote_server_name username@git_server_ip:/path/to/git_repo

This worked for me:

git add . --force

In my case, there was a .git folder in the subdirectory because I had previously initialized a git repo there. When I added the subdirectory it simply added it as a subproject without adding any of the contained files.

I solved the issue by removing the git repository from the subdirectory and then re-adding the folder.


Both "git add *" and "git add SocialApp" called from top directory should add recursively all directories.

Probably you have no files in SocialApp/SourceCode/DevTrunk/SocialApp and this is the reason.

Try to call "touch SocialApp/SourceCode/DevTrunk/SocialApp/.temporary" (and check .gitignore) and then try git add again.


I simply used this:

git add app/src/release/*

You simply need to specify the folder to add and then use * to add everything that is inside recursively.


If you want to add a directory and all the files which are located inside it recursively, Go to the directory where the directory you want to add is located.

$ cd directory
$ git add directoryname