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/D
SETUP
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
I just needed to do this, and I found that you can easily add files in subdirectories. You only need to be on the "top directory" of the repo, and then run something like:
$ git add ./subdir/file_in_subdir.txt
This worked for me
git add -f *
There are times that I want to include my web service source codes along with its client-side project. Both of them have a separate git repositories. I am actually used to add all files using the command:
git add -A
But for some reason, it only adds the folder. Later on I found out that the server files also have its .git
folder in it so the command doesn't work.
tl;dr: Make sure there are no .git
folder inside the folder you want to stage.
I also had the same issue and I do not have .gitignore file. My problem was solved with the following way. This took all sub-directories and files.
git add <directory>/*
git add --all my/awesome/stuff/
works for me. [1]