step1.
git init
step2.
a) for all files
git add -a
b) only specific folder
git add <folder1> <folder2> <etc.>
step3.
git commit -m "Your message about the commit"
step4.
git remote add origin https://github.com/yourUsername/yourRepository.git
step5.
git push -u origin master
git push origin master
if you are face this error than
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/harishkumawat2610/Qt5-with-C-plus-plus.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Use this command
git push --force origin master