how to apply an older patch in local GIT repository?

How can I copy someone else's existing GIT repository, edit it, and then push my changes back?

  • Is "git clone" the correct command? Should I do "git init" first? "git checkout"?

  • Answer:

    git clone will copy the repository (including history) to your dir and check out a local copy, you then can the edit and commit as you like. If you want to publish the changes to the original repository, you can use git push (this depends on permissions of course). If you are using github, you can additionally fork a repository to your own homedir and the clone from that, this means that you can push your own changes to your repository first and then request the changes to be pulled from your repository (this is called pull request in github). git init will create an empty repository that can be cloned or pushed to, this is not necessary when you already have a repository to clone from. git checkout is used to check out different revisions from the locally cloned repository to the local checked out sources, e.g. if you want to switch branches.

Alexander Lehmann at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.