How to add files to a git repository?

3 answer(s)
Answer # 1 #

For multiple files, use:

git add .
This adds all untracked and modified files to staging.

[27 Day]
Answer # 2 #

To add files to a Git repository, follow these steps: 1. Navigate to your project folder using terminal or command prompt. 2. Initialize Git if not already done:

git init
3. Add files to staging area:
git add filename
4. Commit the changes:
git commit -m "Add initial files"
5. Push to remote repository:
git push origin main

[29 Day]
Answer # 3 #

Make sure your remote repository is set up using git remote add origin <URL> before pushing.

[22 Day]