------------- One Idea Can Change Your Life -----------------

What is Git and GitHub? Learn Git and how to push your project on GitHub

 Introduction to git: 



What is git? 

Git is a version management system or version control system (VCS). There also have lots of version control system like SVN, Bazaar, Mercurial etc. but git is faster than other VCS. Basically git is use for manage code and review code. That means you can review your past code and manage it. It is easy to mange code when multiple developers works together with a project. 

Most usable things which you should to follow for git

  • Commit 
  • Push
  • Pull
Commit means saved record or registered which you have worked on locally. And all things will occur in local machine. 
Push means when you will put your work on server. If you keep your work on server which you have done then its call push.
Pull means if you want to take others work form server to your machine then its call pull.

Other things which you should to follow for git: 
  • status
  • add
  • diff
  • log
  • show
  • reset 
  • branch
  • checkout
  • merge
  • stash

What is GitHub? 

GitHub: GitHub is a web-based Git repository hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features.

Cheat Sheet of git operation: 

First you need to install Git in your operating system. After install git then follow the cheat sheet. 

Go to your folder and open git bash

# for git initialization of your folder type git init


Create your own file I have created here a text file which name is nex.txt.txt 
# For show new file which have not added into git and add this file into git you need to type 
git status then add this new file into git type 
git add filename 


Now for commit you need to type  git commit -m " added new file "  


How to push your project into GitHub? 

Go to your project folder which you want to push on GitHub. then open git bash terminal. Then type following command step by step. 
Step 1: first create your git Repositories 
Step 2: then come to git bash and type git config --global user.name "your name"  then enter.
Step 3: type git config --global user.email "your email address" 
Step 4: type touch .gitignore 
Step 5: type git init 
Step 6: type git add . 
Step 7: type git commit -m "initial commit" 
Step 8: type git status for check the commit status 
Step 9: go to your GitHub repositories and copy SSH link following this image 

Step 10: type git remote add origin "paste your repositories link here"  if you face any problem to add your repositories then search google for hot to do SSH keygen 
Step 11: type git push origin master 
 
No more today. Next blog I will discuss about another feature of git.
Thanks for your time to keep supporting for new updates.

No comments

Powered by Blogger.