xxxxxxxxxx
/*
|==================================================================
| How to init and push local repository code to remote (github)
|==================================================================
*/
STEP-1 (Initialize git ropository on local machine)
git init
STEP-2 (add all file to local git repo)
git add .
STEP-3 (commit your code to local repo)
git commit -m "first commit"
STEP-4 (select branch)
git branch -M main
STEP-5 (add remote address to local git repo)
git remote add origin https://github.com/Shahzad-Mahota/test-project
STEP-6 (push code to remote)
git push -u origin main
xxxxxxxxxx
Create a new repository on the command line
git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/neetigyachahar/codebox.git
git push -u origin main
xxxxxxxxxx
git remote add origin https://github.com/User/Project
git branch -M main
git push -u origin main
xxxxxxxxxx
# Create a new repository on the command line
touch README.md
git init
git add .
git commit -m "first commit"
git remote add origin https://github.com/c0ldlimit/vimcolors.git
git push -u origin master
# Push an existing repository from the command line
git remote add origin https://github.com/c0ldlimit/vimcolors.git
git push -u origin master
xxxxxxxxxx
git remote add origin https://github.com/IbrahimMohammedAnyarsYorda/Classes-and-Models.git
git branch -M main
git push -u origin main
xxxxxxxxxx
git remote add origin https://github.com/ihechikara/git-and-github-tutorial.git
git branch -M main
git push -u origin main
xxxxxxxxxx
git remote add origin https://github.com/IbrahimMohammedAnyarsYorda/Classes-and-Models.git
git branch -M main
git push -u origin main
xxxxxxxxxx
git remote add origin https://github.com/IbrahimMohammedAnyarsYorda/Classes-and-Models.git
git branch -M main
git push -u origin main
xxxxxxxxxx
git remote add origin https://github.com/IbrahimMohammedAnyarsYorda/Classes-and-Models.git
git branch -M main
git push -u origin main
xxxxxxxxxx
$ git push origin main
# Pushes the changes in your local repository up to the remote repository you specified as the origin