I have a local git repository hosted in local sever.I would like to add the project to github repository. I would like to keep my local repository as the main repository and github repo as backup repo.
Is it possibly to keep the history(commit history) when I'm adding project to the github?
I would like to "push" every commit to local git repository, so can I sync all the local repo pushes with github repo?
If above two possible, how could I achieve?, If there are link which I could refer?
Udeshika
Seems like you want to push existing git repository to Github
https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
Create a new github repo, copy its link and add the remote to your local repository.
git remote add origin <remoteRepoUrl>
Then push your local git branch to Github. I am assuming it is master branch.
git push origin master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With