GIT Basic - need help or advise

So, I’m going through all the course work, and am currently on the Quality Assurance Translator project. In the interest of learning, I have been doing each using a different method (replit, locally with VSCode, etc). I’m doing this one locally, but decided to give this git program a try since the course says you can clone the github project to your local machine. Upto this point I’ve just been downloading the zip file, and extracting it in VSCode.

Anyway, I installed git to my system, and within VSCode I used git for the first time to acquire the needed project files.

git clone https://github.com/freeCodeCamp/boilerplate-project-american-british-english-translator.git

It worked, and created a new directory with all the project files. We’ll, I’ve started working on them, and have noticed that its tracking changes. I understand that’s what git is for, but its got me concerned because my options seems to be “commit” my changes, which makes me think it will upload my changes to the original github repository ruining it for everyone, or “discard” my changes, suggesting it will erase all my work.

So now I’m looking into how to sever the link between my local copies and the original github repository, if there is one. Anyone familiar with this? If I Commit, will it only save changes to my local machine and not corrupt the original FCC repository? Am I running the risk of accidentally erasing all my work with that looming discard button? I definitely intend to learn more as I go, but don’t want to continue doing any work on this current project until I can ensure I can safely save my changes without running the risk of corrupting the original FCC copies, or having it discard my changes because they’re out of date or something.

I’ve found the hidden .git folder, but don’t want to loose a week working on this project trying to figure it all out at this point.

1 Like

Without having permissions for the original repository you won’t be able to accidentally push changes to it, no worries.

Everything you do locally, commit, make new branches, etc., stays locally until it’s explicitly pushed to the remote server. (But as mentioned before, in this case pushing is not a concern).

As making actual changes in the original repository requires additional permissions, the usual process for that looks something like:

  • Make fork of the original repository on github.
  • Clone the fork locally.
  • Make changes locally and commit them.
  • Push changes to the fork.
  • Create pull request to merge changes from fork to the original repository.

If you’d still want to explore removing information from which repository clone was made from, take a look at the git remote command and it options.

Awesome, spent the evening reading up, and definitely thank you for your reassurance. As I’ve already cloned the original repo instead of a fork and made substantial changes, can I push to something besides the original (like push to a new repo of mine, or fork it, and redirect my local project to the new forked project?

Actually, reading up on remote like you suggested, I have found the URL assigned to Origin, and looks like I can modify that URL, or just remove Origin, and create something new to push to… definitely the point in the right direction I needed. Thanks.

Yeah, each cloned repository can have multiple remotes, which can be used to pull (for example, updating local main branch from the main branch of the original repository) or push code. In case of working on forked repository, convention is to set/call fork as origin, while original repository as upstream.