I have a remote git repository and a local clone. Let's say I lose the local .git directory, and then add and delete some files to the local working directory.
At some point, I want to restart the local repo, connect it to the remote computer and, ultimately, direct the local working directory to remote access exactly as it is (that is, I want all the added / deleted files to be same on the remote control)
How to do it?
Here is my current solution that I don't like (and may not work in all cases).
git init
git remote incremental source [some_url]
git add. # adds all files to the working directory
git commit -m "add files"
(At the moment, my current idea is:
make a branch
take the remote into it,
'git div master branch> my_patch'
apply this patch to a branch,
click from branch to remote control,
pull in the master
and kill the branch.)
Clearly, my idea is quite complex and ugly. Any ideas?
source
share