0

So, I'm working on a project for school, and our professor wants us to send him our code with a bitbucket git repository. I've been using bitbucket the whole semester, but now when I go to make a new repository in a new folder, it adds commits and files from a different repository from a different folder.

I navigate to my new folder Spring2018/iOS/Projects/Scoreboard, and do the git commands to add this folder to my new repo in bitbucket. However, when ever I commit and then push, it also includes all the files and commits from a different project in a different path - Spring2018/GameDev/Projects/Shooter. After the Spring2018 folder, these are two different paths. Why are all my commits from the other folder being added to my new repository?

As a side note, it also always gives me the error: fatal: remote origin already exists. So I need to set the url: git remote set-url origin https://.....

Any help would be extremely helpful. Thank you!

Link1600
  • 1
  • 2
  • Sounds like one of the parent folders is already a git repo. Try [`git rev-parse --show-toplevel`](https://stackoverflow.com/a/957978/6352706) to see the root of the git repo. – Ben Harris Jan 26 '18 at 15:25

1 Answers1

1

You are, I think, creating a git repository inside another.

I would say you have an extra .git file in Spring2018 or somewhere preceding this folder. Check if you have git files like that in folders containing your project.

  • Thanks for answering. How do you check to make sure there isn't a .git file? I'm really new to this. – Link1600 Jan 27 '18 at 02:37