Thursday, January 15, 2015

Basic git operations

Git is a version control system and GitHub is a web-page on which we can publish our Git repositories and collaborate with other people.

The basic commands used are:

To initialize a project in local, go to the project directory and use the following command which will create a .git folder.

   1: >git init <project name>

To check the status of the repository use the status command.


   1: >git status

To track the files created or modified locally, add command should be used.


   1: >git add *

or



   1: >git add *.js


or



   1: >git add <file name>

To attach git repo to local workspace


   1: >git remote add origin <git url>
To commit changes to head


   1: >git commit –m “Commit my changes”
To push the changes to master branch in server


   1: >git push -u origin master
To pull an existing repo to the local


   1: >git pull


Thanks.
Bimal

No comments:

Post a Comment