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.
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 init3. Add files to staging area:
git add filename4. Commit the changes:
git commit -m "Add initial files"5. Push to remote repository:
git push origin main