if you are on a windows machine you will need to start git bash from which you will get a command line interface then use these commands
git init //this initializes a .git repository in your working directorygit remote add origin <URL_TO_YOUR_REPO.git> // this points to correct repository where files will be uploadedgit add * // this adds all the files to the initialialized git repository
if you make any changes to the files before merging it to the master you have to commit the changes by executing
git commit -m "applied some changes to the branch"
After this checkout the branch to the master branch
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.
git add --all my/awesome/stuff/
works for me. [1]
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 *