Created
April 28, 2023 05:11
-
-
Save prashantdsala/1aded830bfdca2210764fb044f37dcb8 to your computer and use it in GitHub Desktop.
Push to new or existing repository on github/gitlabs
This file contains 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
// Git global setup | |
git config --global user.name "your git username" | |
git config --global user.email "your git email address" | |
// Create a new repository | |
git clone <.git url> | |
cd project_folder | |
touch README.md | |
git add README.md | |
git commit -m "add README" | |
git push -u origin master | |
// Push an existing folder | |
cd existing_folder | |
git init | |
git remote add origin <.git url> | |
git add . | |
git commit -m "Initial commit" | |
git push -u origin master | |
// Push an existing Git repository | |
cd existing_repo | |
git remote rename origin old-origin | |
git remote add origin <.git url> | |
git push -u origin --all | |
git push -u origin --tags | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment