I have a repo on my local computer. I want to develop and make changes in a branch on my local repo and then push these changes for testing to a repo on a server that I can ssh into. How do I do this? I have never pushed/pulled from the local to the server, only pulled down through SSH from my bitbucket account to either my local computer or remote server.
Thanks, Mo
You can create a repo on the server by logging in to it, and do a git init --bare
.
Then on you local computer you
git remote add serverrepo <url to server repo>
Now you can push and pull to the serverrepo, and to origin (bitbucket?).
You can push your branch to just the serverrepo if you wish:
git push -u serverrepo branchname
If you need to "publish" the repo on the server somehow, you can follow this guide.
If you want to avoid the command line and are using Atlassian SourceTree do Repository->Add Remote on the source repository and then you can push your changes to the destination.
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