Created
June 7, 2022 12:12
-
-
Save canxerian/4265da0d65046e54ba7553a618bb1d47 to your computer and use it in GitHub Desktop.
Make a local git repo remote, i.e track GitHub, GitLab, DevOps etc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Suppose you've been working on a local repo and now wish to host it on GitHub, GitLab, Azure DevOps etc. | |
# These git commands will enable you to do so whilst keeping history intact | |
# 1. Use the GitHub/GitLab/DevOps web interface to create the repo. | |
# Copy the URL to the repo (https option). | |
# 2. In your repo, add it as a remote | |
git remote add origin <REMOTE_URL> | |
# 3. Push your changes to the remote repo | |
git push origin <NAME_OF_LOCAL_BRANCH> | |
# That's it! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment