Justin808
Justin808

Reputation: 21512

Git - Add all new files in the repo

I'm trying to automate an update process. The process is basically:

  1. Check out repo A
  2. Check out repo B
  3. Run a process in repo B that updates/creates a bunch of files
  4. Copy files into repo A
  5. Compile repo A and make sure it doesn't fail
  6. Commit changes into repo A and repo B
  7. Push changes to the remote server.

Everything is working as expected except step 6. I can commit the changes, but how do I commit any new files? I tried git add . as I've read elsewhere but that doesn't catch all the new files in all the sub directories. Is there an easy way to do a "Add all new files"?

Upvotes: 28

Views: 71767

Answers (4)

DRD
DRD

Reputation: 65

I know I'm late to the party here, but you can also do git -a -m "commit message here". This takes care of adding files as well as committing them in one command. I use this command pretty heavily.

Upvotes: 2

Angel Angel
Angel Angel

Reputation: 21678

You can use git add -A As already mentioned or the long subcommand git add --all

Upvotes: 7

Adam Dymitruk
Adam Dymitruk

Reputation: 129566

git add -A

will stage all modifications to the working tree. Add really means "include in the index" or "add changes to the index".

Upvotes: 31

Hayk Martiros
Hayk Martiros

Reputation: 2186

Take a look here. Perhaps you're interested in git add -u or git add -A.

Upvotes: 30

Related Questions