Are we allowed to clone git repos into the same larger folder...?

Are we allowed to clone git repos into the same larger folder...?
0

I am trying to contribute to open-source projects.

I started with this one >>> Contribute to this github repo.[First Time Contributors]. And that was fine.

So then I decided to try a " real" one with FCC >>> https://github.com/freeCodeCamp/freeCodeCamp/issues/38005

I got as far as these steps:

  1. Fork repo into own github account
  2. Clone to local machine using cmd line:
    git clone https://github.com/SabahatPK/freeCodeCamp.git
  3. I cloned it into the same larger folder that I cloned the first open-source contribution repo:

So now this is what it looks like in Explorer:

  1. So once the clone finished I noticed some strange messages:
Checking out files: 100% (9374/9374), done.
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'
  1. Tried git status to see what was up:
On branch 'myCard'

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        Contribute-101/
        freeCodeCamp/

nothing added to commit but untracked files present (use "git add" to track)

My question is - why am i not on master branch…myCard is the branch I created for the first open-source repo…how did it get mixed up here…? And how can I fix this…? I’ve tried moving to master branch…or unchecking out myCard branch…but (a) I don’t really know what I’m doing and (b) nothing happened.

Thanks!

You aren’t in the freeCodeCamp folder.

And you shouldn’t be able to run git status in the folder above it and have the console print anything meaningful anyway.

Your structure is like this:

ContributeToGithub/
  |_ .git/
  |_ Contribute-101/
  |_ freeCodeCamp/

At some point you have initialised that whole folder to be tracked by git. That’s the only way you get that status message. Basically you’re trying to track everything in that folder. git will happily do that for you, but it’s not what you want.

Delete the .git folder in the root.

cd into the freeCodeCamp folder, go from there

Thanks @DanCouper !

I tried this cmd in parent folder: rm -rf .git/

But received this message - 'rm' is not recognized as an internal or external command, operable program or batch file.

Since you are using Windows, you will need to use the following:

rmdir /s .git
1 Like

Thanks @RandellDawson, that worked. Unfortunately, it looks like that issue was picked up and resolved by someone else. How sad.

There are plenty of issues you can work on. I am sure you will find something else to fix.

Yes, you are right. Will keep eye out for next issue. I was hoping to ease my way into contributing to open-source within the more welcoming FCC environment.

In the meantime, I’ve been looking through this: https://github.com/MunGell/awesome-for-beginners#javascript