D
D
Dmitry Korolev2015-11-02 23:06:44
git
Dmitry Korolev, 2015-11-02 23:06:44

How to synchronize local and remote repository?

There is a git repository on GitHub and a copy of it on a flash drive on a computer. For some time I was writing code without sending it to GitHub, saving everything on a flash card (there was no Internet), and then the operating system broke down beyond the possibility of recovery (all the code remained on the flash card).
The system was reinstalled, the code with numerous changes on hand. I would like to do a git push to the repository on GitHub, but I have no idea how to do it correctly. Re-initialize a new local repository, connect to a remote one, and then git push?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nazar Mokrinsky, 2015-11-02
@Dobermann

I hope the commits at least did something?
If so, just do a git push from the current project folder.
If at all a local copy without git is to clone the remote repository, then demolish the contents of the local copy except, in fact, the .git folder and upload new files, then add everything to a new commit and the same git push.

A
aol-nnov, 2015-11-02
@aol-nnov

on a bare repo flash drive?
if so, clone it locally, then git remote add github [email protected]:user/project.git and git push github master

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question