Thumb

Part-3: Commit changes in github and push to repository using bash command | git Add, Commit, Push

5/18/2020 3:26:09 PM

Step 1:

  • Watch my previous video[GitHub Part-2] and article[GitHub Part-2]
  • Change any file inside your cloned repository into your directory.

Step 2:

  • Open your bash command prompt.
  • Know your current path by entering the below command

pwd

  • After entering this “pwd” it will appear like below directory

/c/ Users/Desktop

  • Go to your expected directory by entering below command

cd  /c/Work

here I want to clone my repository project into “Work” folder.

  • Write below code to add changes to commit

Example1: git  add  -A  &&  git commit -m  "This is first commit"

if you want to commit only one-file/one-file change then instead of Example1 use Example2.

Example2: git  add  indext.txt &&  git commit -m  "This is first commit"

  • Write below code to Push the added changes

              Example: git push origin master

  • Then a poup will open to provide your GitHub credentials.
  • Then your changes will updated to your repository

 

About Teacher

Image

Reza Karim

Software Engineer

More about him