DEV Community

GharamElhendy
GharamElhendy

Posted on • Edited on

How to Push Commits to a Github Repo Using Git Bash?

The lines on the command line should go as follows:
pwd >>> This is to check the current directory

cd /c/Users/... >>> This is to change it to whatever the name of the designated directory is

get init >>> This is to initialize your local directory as a Git repository

git add . >>> This is to add the files to your newly created repo as well as stage them for the first commit

git commit -m "initial commit" >>> This is to commit the files from the previous step to the local repo

git remote add origin HTTPS://URL >>> This is written in the command prompt to push the local repo to your online one

git remote -v >>> This is a continuation of the step above

git push -f origin master >>> This is to finally push the changes that you made to your local repo to your online one

Git_It

Top comments (0)