GIT Add Files and Commit Demo


To add files in Git, there are various commands available based on the scenario. Here are some of the commonly used Git commands for adding files:

  1. Add all files in the working directory to staging area:
      git add .
  1. Add a specific file to staging area:
git add <filename>
  1. Add all files of a specific type to staging area:
git add *.txt
  1. Add all files in a specific directory to staging area:
git add <directory>/

After adding the files to the staging area, you can commit them using the following command:

git commit -m "commit message"

Note: Make sure to provide a meaningful commit message that describes the changes made in the commit.