push folder to git repository code example

Example 1: git upload folder

git init
     git add <folder1> <folder2> <etc.>
     git commit -m "Your message about the commit"
     git remote add origin https://github.com/yourUsername/yourRepository.git
     git push -u origin master
     git push origin master

Example 2: 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 3: create new repository on the command line

git init
git add README.MD
git commit -m "commit message"
git remote add origin git url_of_github_repo
git push origin master

Example 4: how to push to git hub

git push  <REMOTENAME> <BRANCHNAME>