clock  Mon - Sun 8.00 AM - 8.00 PM
mail  edu@teknowize.com
fb
instagram
play store
pinterest

How to adds a file or folder to the Git staging area using 'git add'

  Hariom Prajapati
  07 Aug 2022
  Git
Imperial Advance Hero Image

How to adds a file or folder to the Git staging area using 'git add'

In this tutorial we will see how to adds a file or folder to the Git staging area using git add.

let's see example -

1) Add a specific folder or file to git staging area

git add file_name

git add

2) Add all files or folder to git staging area

git add -A

or

git add .

Git Add

 

Note - The process for changing a file or folder in a Git repository are like-

  1. Update a file or folder in the Git repository from your system.
  2. ➡️ Use git add to add those changes to the staging area.
  3. ➡️ Use git commit to move changes from the staging area to a commit.
  4. ➡️ Use git push to push those changes to the main repository.