Git Clone Question (FCC Project Problem)

May I ask what is the correct flow to clone the boilerplate projects and push them to my own repo?

I successfully cloned the Metric Imperial Converter project, but then I may have done something wrong. I ran the following commands:

 $ git checkout -b master
 $  git status
  $ git remote add origin https://github.com/camchardukian/FCC-Metric-Imperial- Converter.git 
// received an error because I already had the default remote origin setup via git clone 
  $ git remote add orig https://github.com/camchardukian/FCC-Metric-Imperial-Converter.git
  $ git branch -M main
 $  git push -u orig main

Unfortunately, after completing these steps my repo displays exactly the same as FreeCodeCamp’s boilerplate repo including a long list of contributors.

My plan was to document my progres as I worked through the Metric Imperial Converter project just like I did for the calculator project

I’m not sure where I went wrong, however, and what I should do to make a “clean” or “fresh” repo to document my progress working through this project and show only myself as the contributor (I want potential employers who look at my GitHub to see this project as a solo effort with perhaps an attribution link in the README to FCC.).

Can anyone give me some guidance? Thank you :smile:

To delete history delete the hidden .git folder and run git init.

1 Like

Any changes you add to the existing boilerplate would still show as your solo effort. Not including the pre-existing commits makes it appear you wrote all of the code present in the boilerplate, which is not true. A lot of the boilerplate code was written by freeCodeCamp staff or other volunteers. If you had created a repo of your own and someone else cloned it and removed the git history to make it appear as if they wrote all the code, wouldn’t that bother you?

2 Likes

Yes Randell, that makes sense. I guess I was just unfamiliar with how I should be going about this. I was worried that the way I did things initially would make it look like I was trying to take credit as the creator of the original repo because of all the contributors names appearing on my profile or that having two git remotes would screw up by repo somehow.

I didn’t mean to diminish the efforts of you, the FreeCodeCamp staff, or any of the wonderful volunteers who may have contributed to making these projects available for the community. I sincerely apologize if that’s how it came off.

I made this post at the end of a long workday so maybe I wasn’t thinking clearly and was being a bit of an airhead :sweat_smile:

In any case, does that mean my original Git flow was correct and that I can just continue making additional commits to my Repo in good conscious?

I did not take it that way. I was just making sure you understood what removing the history would be doing.

If you want to start over, you can delete the cloned repo from GitHub and just do the following:

git clone https://github.com/freeCodeCamp/boilerplate-project-metricimpconverter.git
git remote remove origin
git remote add origin https://github.com/camchardukian/FCC-Metric-Imperial-Converter.git
git branch -m "main"
git push -u origin main

Thanks for the tip, and helping me better understand the git history stuff. Following your steps would just be an improvement because it would result in only one git remote location instead of two right?

If you forked the boilerplate and cloned it, then you could simply do:

git clone https://github.com/camchardukian/boilerplate-project-metricimpconverter.git
git branch -m "main"
git push -u origin main

You would still need to have created the repo in your account with the same name. In that case, you would only have a branch named main in your repo after the push. If follow the forked directions above (assuming you forked the repo), then you would still manually need to delete the gomix branch from GitHub to only have one branch.

In general, your “main” branch is your “best version”. You would create other branches off of it and merge them back into “main” when you are satisfied the changes of a branch “works”, then delete the branch.

1 Like