Home Blog

Git Tutorials

November 21, 2017 | Stark Digital |


Here are few git commands for accessing git based projects properly.


1. Create Clone (local version) of a git repository (a.k.a. repo):

> git clone {github repo url}

2. Create branch from current branch:

> git checkout -b {new branch name}

* Always keep current branch (a.k.a. base branch) note. 

3. Download branch code locally.(Pull)

> git pull origin {branch name}

4. Upload your code remotely (on repository)

> git push origin {branch name}

5. Add new files in your current branch.

> git add .


> git add {File name with path}

6. Commit your changes to remote branch.

> git commit -m {commit message}

7. Switch branches locally

> git checkout {to branch name}

8. Remove branch locally.

> git branch -d {branch name}

9. Remove branch remotely

> git branch -d origin/{branch name}

10. Show last commits

> git log


These are few basic commands. I will add advance commands in next week till then bye..




About the author


Stark Digital

We have been in the field of web designing & software development for more than 7 years.