Skip to content

Tips and trick for Git

jooyce edited this page Dec 6, 2011 · 12 revisions

Set up Git for Unix sytems

Create your github account

https://github.com/signup/free

Install Git

#apt-get install git

Configure your git installation

http://help.github.com/linux-set-up-git/

Initialize Git

Go to your project folder and execute this command
$git clone [email protected]:ndubuis/Ski-school-bsl.git

Set up Git for Windows systems

Create your github account

https://github.com/signup/free

Install Git

Download and install this application
http://code.google.com/p/msysgit/downloads/list

Configure your git installation

http://help.github.com/win-set-up-git/

Initialize Git

Go to your project folder and execute this command
$git clone [email protected]:ndubuis/Ski-school-bsl.git

How to create a branch on the remote

git push origin origin:refs/heads/nameofyournewbranch
By default the newest branch is based on origin/master branch

How to delete a branch on the remote

git branch -r -d origin/nameofthebranchtodelete
When you delete a branch on the remote, it don't delete this branch to the people who have this branch in local

How to track a remote branch

git checkout --track -b nameofyourlocalbranch origin/nameoftheremotebranch

How to push your modification on the remote

git push origin nameoftheremotebranch

How to switch to an another local branch

git checkout nameoftheanotherlocalbranch

Clone this wiki locally