how to push code to remote git repository code example

Example 1: git push new repo to remote

$ git remote add origin <remote repository URL>
# Sets the new remote

# Push the changes in your local repository to GitHub.
$ git push -u origin master
# Pushes the changes in your local repository up to the remote repository you specified as the origin

Example 2: initialize a repo and push to github

git init
git add -A
git commit -m 'Added my project'
git remote add origin [email protected]:sammy/my-new-project.git
git push -u -f origin master

Example 3: how to push existing project to github

git remote add origin 
      https://github.com/asd/FinraDeck.git (github adresi)git push -u origin master

Example 4: how to add a repository to github

git & github