DEV Community


How do I NOT to commit changes to other people's github repos I clone for learning?

・1 min read

I like trying out many lesson projects. Often they involve cloning github repos. I know the repos aren't mine and I often add a lot of my own commentaries for my personal learning purposes.

I use vscode as my editor. Vscode tracks my changes and asks me to commit them but I really don't want to do that at all.

I'd rather keep my personal learning notes and comments private at this point. It's not that I don't want to share them. It's more that as a newbie I'd be embarrassed to so so. Maybe later on.

I normally don't fork the repos. I download them into my personal local projects folders. After a bunch of not committed changes, vscode gives me a message something like I have too many uncommitted changes.

Can anyone give me some advice on how to do all my local learning commentaries and notes without publishing them in github or becoming a nuisance with ridiculous pull requests, and stop vscode from telling me I have too many uncommitted changes?

Discussion (3)

andrewblyth90 profile image
Andy Blyth

As far as I am aware, when you clone a repo it is not connected to the remote repo. So if VSCode is asking you to commit, it will be to your local repo. Hope that makes sense.

torqu3wr3nch profile image

This is correct.

The diff you see in VS Code's source control (git) is a comparison of changes within your local repo, as such there is no harm in committing them:

VS Code Source Control

They won't push to the remote repository (i.e. upload to Github) unless you explicitly tell VS Code to do so, by either clicking on "Push", "Push To", or the little upload cloud on the bottom that indicates "Publish changes". (By the way, push requests are distinct from pull).

Since it sounds like at some point you may want to publish your notes, if I may make one other recommendation, after you clone a repo locally, create a new branch and make your changes there. This will make publishing your changes easier in the future. To create and checkout a new branch, you can use the following command after cloning: git checkout -b

The above command both creates the new branch and checks it out, meaning it switches your working directory to it. If, in the future you need to go back to that branch and it already exists, you can simply use git checkout .

I encourage you to fork though, that way everything isn't just sitting on your local computer.

Hope this helps!

silvanet profile image
silvanet Author

Thanks, I've been so confused about that but once you mentioned it I was able to make a search that found a clear (to me) explanation of forking and cloning in the Github community forum, here. I really appreciate your response. I really have to get much better informed about Github. A friend recently told me you can even use it to keep track of revisions on documents you're writing. I do a lot of writing, so that could be useful to me.