Home > Enterprise >  How do I push to my GitHub repo without cloning it again?
How do I push to my GitHub repo without cloning it again?

Time:07-01

My PC died a few weeks back, I've replaced it since, but I'm now unsure as to how to push to my repo without having to re-clone the entire repo again on my new PC.

I've created another SSH key and linked to my GitHub.

CodePudding user response:

Since you are talking about pushing, i assume you have the local repo on the new computer and you've installed the git client on the new computer.

You can do a git pull or git fetch request so that you can reconnect to the repo.

After entering the git pull or git fetch command, your computer will ask for your git credentials, after entering them correctly, you will be able to push to your repo

CodePudding user response:

In order to push to a Git repository, you need to have a local clone of the repository from which you're pushing. That's because a push involves sending objects which the local copy has but the remote one does not, and that means that both sides must have a repository to perform that negotiation.

So you will need to re-clone the repository on your new PC. Then you can start working in it as before and, once you've made some changes, push to GitHub again.

  • Related