Friday, June 13, 2014

Git Basic Commands


Set user.name and user.email in config file

$ git config --global user.name "John Doe" $ git config --global user.email johndoe@example.com

See the config setting in your git

$ git config --list user.name=Scott Chacon user.email=schacon@gmail.com color.status=auto color.branch=auto color.interactive=auto color.diff=auto ...

Getting Help

$ git help $ git --help $ man git-

Initializing a repository

$ git init

Add a file to the repository

$ git add *.c 
OR $ git add README

Clone a repository

$ git clone git://github.com/schacon/grit.git
OR
$ git clone https://github.com/schacon/grit.git


Clone a repository in a particular folder

$ git clone https://github.com/schacon/grit.git mygrit

Check status of the files

$ git status

Checkout a branch

$ git checkout

Checkout and create a branch

$ git checkout -b

Commit the changes

$ git commit -m "comment"

Push the changes to the branch

$ git push origin

See the logs

$ git log

git

git


References:








Tuesday, June 10, 2014

Find if the port is already in use in Windows

In the command prompt use the following command to find if a port is already in use:

C:\Users\username>netstat -an |find /i "2990"