1

I already did these commands after I made some huge modifications in my app:

git status
git add .
git commit -m "deploying live with heroku"

but still it didn't commit as I see alot of untracked files that are color red

and also I see this after issuing that commit..

On branch master
Changes not staged for commit:

..............< all these modules here

Untracked files:

......................
no changes added to commit

Nimantha
  • 6,405
  • 6
  • 28
  • 69
TheBAST
  • 2,680
  • 10
  • 40
  • 68
  • Possible [duplicate](https://stackoverflow.com/questions/5959010/still-untracked-files-even-after-using-git-add)... – Peter Schneider Nov 02 '19 at 07:48
  • Make sure you run `git add .` in the root directory of your project. It adds the content of the current directory. – axiac Nov 02 '19 at 07:59
  • I already did @axiac look at this https://pastebin.com/MDEEr8S5 for seeing the end part of the result of the git status after i did git add . – TheBAST Nov 02 '19 at 08:00
  • It is a line-ending problem. Windows uses two characters (`CR` and `LF`) to end the lines of text files, Git internally uses only `LF` (Unix line-ending style). – axiac Nov 02 '19 at 08:04
  • It could be solved by [configuring Git properly](https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreeol) but I think it is better to avoid it. Nowadays most Windows text editors can handle files that use the Unix line-ending convention. – axiac Nov 02 '19 at 08:09
  • The first answer of [this question](https://stackoverflow.com/q/1967370/4265352) explains very well how it works. – axiac Nov 02 '19 at 08:12
  • Hey guys this is a private repository that I'm going to upload to, does this matter when deploying it all – TheBAST Nov 02 '19 at 08:17
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/201754/discussion-between-thebast-and-axiac). – TheBAST Nov 02 '19 at 08:25

2 Answers2

1

try following command to add untracked and modified files to staging index.

git add -A;
Fraddy
  • 331
  • 1
  • 8
  • I get this fatal: unable to stat 'composer.': No such file or directory – TheBAST Nov 02 '19 at 08:29
  • 1
    check link https://stackoverflow.com/questions/14161297/git-error-fatal-unable-to-stat-no-such-file-or-directory to resolve fatal issue. – Fraddy Nov 02 '19 at 09:54
  • Yeah there's a file that was named `composer.` which could be a big issue for git probably because it was named without a file name. – TheBAST Nov 02 '19 at 13:01
  • When I try to do like : `git rm "composer." fatal: pathspec '.' did not match any files ` – TheBAST Nov 02 '19 at 13:19
  • can you print git status output if you are ok with it? If yes then only print relative path w.r.t root directory of project. – Fraddy Nov 02 '19 at 14:09
-3

Try these commandm It will work. Add your files into staging by this command $ git add --a

$ git status -s
$ git add --a
git commit -m "Your Commit Message"
git push -u origin master
Kaleemullah
  • 446
  • 3
  • 8
  • $ git commit -m "first heroku deploy" On branch master Untracked files: ................ ..... nothing added to commit but untracked files present ``` – TheBAST Nov 02 '19 at 07:51
  • 2
    There is no such option as `--a`. You probably want `-a` but it doesn't help here. Also, `git push` is not related to the question and it doesn't help. – axiac Nov 02 '19 at 08:14
  • @axiac Apparently Git interprets `--a` as `--all`, I suppose because there's no ambiguity. The equivalent short form would be `-A`. – alfunx Nov 02 '19 at 17:09
  • Exactly sir, i mostly used this. I told him – Kaleemullah Nov 02 '19 at 17:11