How to push/commit when you have downloaded the master?

So I’m pretty new.

I have some group work on github. I was invited to the repository. I clicked to download the zip of the repository. I then did some of the code. Saved the file to my computer.

And now I need to push/commit that back to the master? How do I do that? I downloaded git desktop but it looks like I messed up becasue that tells me to clone, do I need to redo my work? I’m just confused.

Thanks in advance

Hey @rosie000, usually when you download as a zip, it’s just a full copy of the code but it’s not connected to the main repo itself. The proper way to collaborate is to git clone the repo and then make your changes to it. With that said, a potential workaround that I have had to use myself a few time is as follows: 

  1. Git Clone the repo’s master branch to a known location on your computer (like the Desktop).

  2. Open up file explorer or finder and then move the “.git” folder from your cloned version into the top level of the version you downloaded via zip. This should then automatically make git see the changes. 

  3. From there, you can use the command line (by navigating into that folder) or via GitHub desktop to commit and then push the changes. 

Let me know if you have any additional questions! 

1 Like