Monday, 22 July 2013

How to Install and use GIT (Some Very important and useful commands)

How to Install Git

Type the following commands in the terminal

  1.     sudo apt-get install git

How To Use Git

Type the following commands in the terminal

  • Adding a repository and initial committing
  1. git remote -v
  2. rm -rf .git
  3. git init
  4. git remote add origin ssh:<origin-path>
  5. git status
  6. git add .
  7. git status
  8. git commit -m “<message>”
  9. git push origin master

  • Pushing in the git after initial commit (Here I have mentioned the basic and most important commands needful while push in the repository)
  1. git status
  2. git add .
  3. git status
  4. git commit -m “<message>”
  5. git fetch
  6. git branch
  7. git rebase origin/master
  8. git push origin master
Post a Comment