Search code examples
githubgithub-for-mac

Committing changes to branch I got by downloading zip from GitHub


I'm working on a repository that has two branches: Master, and Release1.

The branch I need is Release1. I went to the site and tried to clone it, but no matter what I did I got the Master branch cloned.

So I gave up and downloaded the branche's zip to my file system. I added it to Eclipse and worked on it.

Now I need to commit my changes. But neither the branch nor the repository show up in my visual tool.

When I try to add a local repository the visual tool tells me the folder is not a repository.

Is there a solution? I have quite a few changes on my local project and I have to commit them.


Solution

  • The Zip download is not a Git repository, it's only a collection of the files at that moment in time. Here's a way you might be able to get your changes into the repository:

    • Clone the repository properly
    • Copy your current files into the cloned directory
    • git status and git diff to check that the changes are what you expect
    • git commit

    When you cloned the repository the first time, you were getting both branches - a Git clone is a fully copy of everything: every branch, all history, etc. The default branch is typically master. After you clone, if you want to switch to the other branch, use git checkout Release1.