0

I am trying to use: git commit -am but I am getting an error command not recognized I used it before but now it's not recognized. the command is git add & git commit combined.

1 Answers1

0

if git add . and git commit -m <commit message> are working. Then git commit -am <commit message> should work.

Please check with first two commands, then try yours. enter image description here

Art Bindu
  • 769
  • 4
  • 14
  • as you can see in the photo the add and commit are working but the am not working https://drive.google.com/file/d/1iohtEYPbUmYKpaMtOqF1TwBhe5EpWdBy/view?usp=sharing – Lidor Oranim Jul 20 '22 at 10:37
  • 1
    The image needs to be made public – Paulo Fernando Jul 20 '22 at 18:18
  • I changed it you can check now – Lidor Oranim Jul 21 '22 at 14:48
  • 1
    git add & commit command: `git commit -am "Enter Your Message within Double Quotation Marks".` You entered command like `git commit -am "trying am" file1`. What is this? Please remove `file1` text from your command. I don't know why you did tricky. For more details check: https://stackoverflow.com/questions/4298960/git-add-and-commit-in-one-command https://docs.gitlab.com/ee/gitlab-basics/start-using-git.html – Art Bindu Jul 21 '22 at 22:15
  • the file1 is like saying I want this commit only on this file – Lidor Oranim Jul 24 '22 at 07:27
  • Run `git status` and check what file/s have changed (It shows in red color by default). Then run `git commit -am `. It should work.. check screenshot: https://i.stack.imgur.com/LjBv6.png – Art Bindu Jul 25 '22 at 06:43
  • `the file1 is like saying I want this commit only on this file`.. You need to use `git add ` and then `git commit -m "Message"` – Martin Jul 25 '22 at 06:48
  • Yes, there are two ways to push a particular file. First, run `git status` and check which file you did. \n Way-01: `git add `↵ `git commit -m ""`↵ `git push origin `↵ . Way-02: `git commit -am `↵ `git push origin `↵. – Art Bindu Jul 25 '22 at 06:53