How do I reverse clone a directory into a repo?
satya - 11/24/2019, 3:10:25 PM
What I meant by reverse cloning
1. In cloning process you clone an existing repo with files on github or gitlab to a local directory. It is always an easier option and should be pursued when you are beginner or even an intermediate-phyte, especially with weak coronary arteries.
2. Sometimes you have local repo that gets created by tools like vscode assuming you will upload that later to a repo. For example when vscode creates an azure function app it creates repo locally. Then we are stuck with syncing it up with a remote repo. This is what I meant by reverse clone
3. So a reverse clone is how do you create or MIRROR a repo on a server similar to or identical to what you have on local.
satya - 11/24/2019, 3:10:43 PM
It is often called MIRROR a repo
It is often called MIRROR a repo
satya - 11/24/2019, 3:11:14 PM
How do I mirror a local repo into a remote repo?
How do I mirror a local repo into a remote repo?
Search for: How do I mirror a local repo into a remote repo?
satya - 11/24/2019, 3:13:06 PM
Advised steps are
1. create an empty repo on the server like github or gitlab. (No readme stuff)
2. See what remotes, if there are any in your local repo. Likely and hopefully you have none
3. Create a remote called "origin" pointing to the remote URL from step 1
4. Then push to that "origin"
satya - 11/24/2019, 3:13:32 PM
Here are some notes that gitlab published to help with this process when I created an empty repo
Here are some notes that gitlab published to help with this process when I created an empty repo
satya - 11/24/2019, 3:14:42 PM
Push an existing repo
cd existing_repo
//Unlikely you will have this
git remote rename origin old-origin
git remote add origin (your-remote-url.git)
git push -u origin --all
git push -u origin --tags
satya - 11/24/2019, 3:15:10 PM
In my case of vscode for a fuction app, the above applied
In my case of vscode for a fuction app, the above applied
satya - 11/24/2019, 3:16:28 PM
In case of an existing folder that is not a repo yet
cd existing_folder
git init
git remote add origin (url)
git add .
git commit -m "Initial commit"
git push -u origin master
satya - 11/24/2019, 3:18:13 PM
My notes on regular clone are here: local link
satya - 11/24/2019, 3:19:09 PM
Journal is here, where when I revisit git after a gap, listed travails
Journal is here, where when I revisit git after a gap, listed travails