Sunday, July 29 2018

Learn Github Commands Tutorial for Beginners

We have posted article for how to learn github commands without using any GUI. In this article we described about fully basic git commands and how to it use in terminal.




1. Configure the author name and email address to be used with your commits.

git config --global "Sam Smith"

git config --global [email protected]

2. Save github credentials in command

git config credential.helper store

git pull

3. Create a new local repository

git init

4. Checkout repository

git clone /path/to/repository

5. List of branches

git branch -a

6. Create a new branch

git checkout -b <branchname>

7. Delete branch

git branch -d <branchname>

8. Checkout branch

git checkout <branchname>

9. Pull

//Fetch files from master
git pull --progress --no-rebase -v "origin"

// Pull from current branch
git pull --progress --no-rebase -v "origin" <branchname>

10. List of files you have changed

git status

11. Add files

// For a specific file
git add <filename>

// For all files
git add *

12. Commit

//Commit new files
git commit -m "<give some message about this commit">

For example: git commit -a "Initial commit for user module"

//Commit existing files
git commit -am "<give some message about this commit">

13. Push

//Push current branch
git push --progress "origin" <branchname>

git push

14. Undo local changes

git checkout -- <filename>

15. Get modified files between master to local branch (File name only)

git diff --name-only master <branchname>

15. Show log

git log

These are some basic commands to use Github for beginners.

Thanks for reading this article. If you have any queries and please comment in below.

Share Your Thoughts


I’m Blogger and Programming Blog, Tutorials, PHP, MySQL, jQuery, Laravel, Wordpress and Codeigniter