I'm trying to commit my changes to the git
but i have this message saying Changes not staged for commit:
. Before, the command that I always used is git add-commit -m "message"
but now i don't know what syntax used now in this version of git which is git version 2.15.0. I looked for the documentation in the git
website but no luck. Can someone help me with this?
Asked
Active
Viewed 5,618 times
0

hihihihi
- 68
- 1
- 5
- 29
-
You have to stage changes before committing. Run `git add --all`. – Daniele Cappuccio Apr 14 '18 at 02:58
-
1Possible duplicate of [What does "Changes not staged for commit" mean](https://stackoverflow.com/questions/21134960/what-does-changes-not-staged-for-commit-mean) – phd Apr 14 '18 at 09:45
2 Answers
4
Either 1) Use the -a
flag for auto add:
git commit -am "your message"
or 2)
git add --all
then
git commit -m "Your message"

JacobIRR
- 8,545
- 8
- 39
- 68
1
Break down the steps to properly understand what is happening inside the hood.
Step 1:
## Add your modified files to stage area using,
git add -u
Step 2:
## Commit/Take snapshot your modified files with message on the staging area
git commit -m "Add php and bash file payroll"
Step 3:
## Push your changes to remote branch using,
git push

A l w a y s S u n n y
- 36,497
- 8
- 60
- 103