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

AuthorHariom Prajapati

Pubish Date07 Aug 2022

categoryGit

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.
Comments 0

Leave a comment