Friday, 3 July 2015

How to make branch ,clone , push, pull and merge in Github


1) GIT COMMAND TO SEE ,HOW MANY  BRANCHES ARE THERE :
     $ git  branch

2) GIT COMMAND  TO MAKE  A NEW  BRANCH :

   $ git branch "ur branch name"

3) GIT COMMAND TO SWITCH  TO SOME OTHER BRANCH :

  $ git checkout  "my_branch"                 (this command will take me to branch- my_branch)


4) GIT COMMAND  TO  DO  CLONE  OF SOME  OTHER'S  OR YOUR OWN'S PROJECT
     WE  JUST  NEED  THE  SSH  CODE OF THAT REPOSITORY:

 $ git clone "SSH URL"



5)  GIT  COMMAND  TO  PUSH  IN SOME OTHER BRANCH

   $ git remote add "variable_name" "SSH URL"
  $ push "variable_name" "branch_name"


6) GIT COMMAND  TO  PULL  SOME BRANCH (before pushing ,it is recommended to pull)
 
   $ git pull "variable" master


7) GIT COMMAND TO MERGE
 
  $ git merge master

No comments:

Post a Comment