1

I have noticed that my git repo does not match mt local project structure? Here is my git: https://github.com/BillyCharter87/Tech-O-Dex-API

Yet my local is al follows below:

enter image description here

I want my git repo to look like my local, essentially getting rid of the inital and test folders? Was my git init started in the wrong place or something?

Thanks.

Billy
  • 1,049
  • 3
  • 14
  • 23
  • What do you get when you run a `git status`? – Naguib Ihab Aug 08 '18 at 02:27
  • `D:\Work\Tech-O-Dex-API>git status On branch master Changes to be committed: (use "git reset HEAD ..." to unstage) deleted: .travis.yml deleted: CONTRIBUTING.adoc deleted: Jenkinsfile deleted: LICENSE.code.txt deleted: LICENSE.writing.txt deleted: README.adoc deleted: run-on-pws.json ` – Billy Aug 08 '18 at 02:30
  • This lists the correct files that were deleted, but the do not reflect on the git repo? – Billy Aug 08 '18 at 02:31

1 Answers1

1

As you can see from the path in the IDE your project only uses the sub directory complete instead of the whole repository. I guess that is OK, since that is where the project files and the pom.xml are located.

Not sure why the directory initial is there in the first place. It looks like a copy of the project, but maybe(?) not up to date with the contents of the complete directory. Check it. You may then want to delete either initial or complete.

If you are sure you want to remove the contents of the directories initial and test (as mentioned: check it), you can do the following in Git:

# remove both directories, intial and test
git rm -rf initial test

After that you can do a git commit to commit these changes.

The directory complete will still be there, however. If you want to move the contents of that directory up one level, you can do it as described here, which boils down to sonething like (untested):

git mv complete/* .
git rm complete
git add *
git commit
Striezel
  • 3,693
  • 7
  • 23
  • 37
  • Ideally I'd like to remove both `initial` and `test` all together as I do not use them for anything. – Billy Aug 08 '18 at 02:37
  • OK, then do `git rm -rf initial test` in the repository's root directory as already mentioned above. – Striezel Aug 08 '18 at 02:46
  • https://github.com/BillyCharter87/Tech-O-Dex-API Now my repo looks like this? Yet my local project structure looks/works perfect? – Billy Aug 08 '18 at 02:49
  • No, that will not work, you have removed too many files. Not only `initial` and `testing` are gone (as should be), but also the project files are gone. Assuming that [commit 1832d3d3d7642f5c1c1c08fac552f2218e4a8c2a](https://github.com/BillyCharter87/Tech-O-Dex-API/commit/1832d3d3d7642f5c1c1c08fac552f2218e4a8c2a) still contains all relevant files, you could do a `git checkout 1832d3d3d76 -- complete` to restore the files of the directory `complete`. – Striezel Aug 08 '18 at 02:59
  • Locally on my machine it works fine, It's just not pushing the `.idea`, `.mvn`, `src` folders? My git ignore is as follows: *.sw? .#* *# *~ .classpath .project .settings bin build target dependency-reduced-pom.xml *.sublime-* /scratch .gradle README.html *.iml .idea – Billy Aug 08 '18 at 02:59
  • Then add the `src` folder with `git add`. The `.idea` folder does not need to be added and also is listed in the `.gitignore` file. That is why it was not added - and thus not pushed. – Striezel Aug 08 '18 at 03:01