0

All I wanted to do was to add all files.

Now I got directories that are just icons and I never saw something like that before.

I just wanted to add all files. I did

git add *
git commit -m "added"
git push

And now I got this incomprehensible mess.

enter image description here

How can you explain this state?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424

2 Answers2

2

Those gray folders are gitlinks (special entry in the index).
They represent nested git repos: the parent repo only records their SHA1 (that you see beside the grey icons)

You need to decide if you want to:

  • record them properly as submodules
  • ignore them completely
  • add their content in your repo (removing their inner .git folder)

Note: don't use git add *: the * is expanded by the shell.
Use git add .

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I want to create a new clean repo after making important changes from another repo. I want to release the connections to the old repo and start this repo as new. – Niklas Rosencrantz Mar 30 '17 at 04:49
  • 1
    @DjDac yes, but do you need the history of all those nested git repos? If not, remove any `.git` directory, do a `git init .` and try again your `git add .` – VonC Mar 30 '17 at 04:53
  • I don't need the history. I made so large changes that it should be like a new start. – Niklas Rosencrantz Mar 30 '17 at 05:02
  • Then removing any `.git` folder you can find, doing a new `git init .`, `git add .`, `git commit -m "first commit"` and `git push --force -u origin master` will work. – VonC Mar 30 '17 at 05:03
0

You can use code below on cmd, cli, shell or git bash.

  1. git status
  2. git add -A
  3. git commit -m "[your commit message]"
  4. git push origin {your-branch}

example:

  1. git status [enter]
  2. git add -A [enter]
  3. git commit -m "new commit" [enter]
  4. git push origin master [enter]

Don't use "git add .", because it will overwrite all of your code.