How to Clone and Push contents to a given remote?

Submitted by Rajasekhar on Sat, 11/10/2018 - 13:38

1. Cloning Repository

  1. Copy repository link from Github (remote).

 

  1. Now clone using Git Bash on your machine.

 

  1. We have successfully cloned a repository from Github (remote). See below images.

 

  1. Work on Cloned Repository on your local machine.
    • For example, Add text file.

  • Add text.

 

  • We have saved the text file with text content as below.

 

  • Add this to track file changes as Git add test.txt

 

  • Now commit this to save changes on the repository.

  • That’s it we have saved the repository with made changes.

 

  1. Push contents of a branch to a given remote (GitHub).
    • Syntax is à git push <remote> <branch>
    • To know remote & branch, Use git remote & git branch.

 

  • Git push origin master à It will ask you for Github account details provide and log in.

 

 

  • Now go to Github repository and check.

 

  • Successfully we have added new contents to the repository. As shown above.