Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I automatically add new files to Git?

Tags:

git

github

I know I can just do git add for all the files, but I got a ton of files. Is there a way to do something like "git add *.h", or "git add *.py" ?

like image 697
Henley Avatar asked Jul 10 '11 16:07

Henley


People also ask

Is there a way to git add all files?

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.

What is the shortcut for adding all files in git?

The -A option is shorthand for --all . Another way to do this would be to omit the -A option and just specify a period to indicate all files in the current working directory: $ git add . Note: The command git add .

How do you add multiple files for commit in git?

To add multiple files in Git, first, navigate to the directory where the untracked files are present and execute the “$ git add” command with the required files name. Then, use the “$ start” command to open added files one by one, make changes and save them.


1 Answers

Yes you can say git add *.py Make sure you have done git init before doing this.

To add all files in a folder you can simply say git add .

like image 92
Prasanna Avatar answered Sep 19 '22 15:09

Prasanna