May 17, 2015

Git Basic Commands

Git is one of the most used source code revision control system nowadays, many companies and websites like GitHub adopted it. And you? if not, soon or later you will need to work with Git. Here you can take a look at some of the most used Git commands.

Clone a remote repository:
git clone <url>

Clone a remote repository just with the latest commit version (saves a lot of space):
git clone -b <branch> --depth 1 <url>

See current configuration:
git config --list

Set username:
git config --global "Your Name"

Set email:
git config --global [email protected]

Save modifications or add files/folders:
git add <file/folder>

Commit to local 'master':
git commit -m "commit msg"

Send local master commit to remote repository:
git push

Remove file/folder:
git rm <file/folder>

Update local repository with the latest version of remote repository:
git pull 

0 comentários :

Post a Comment