Al een tijdje geleden mocht ik de wondere wereld ontdekken die Git heet. (mee) Ontwikkeld trouwens door dezelfde kerel die ooit een os uit z’n mouw schudde.
Soit, nu we op school ook Git gaan gebruiken werd het tijd om wat commando’s op te frissen. En te delen met andere zielen op deze wereld. Je weet maar nooit waar dat goed voor is. 😉
Git installeren blijkt trouwens niet altijd even gemakkelijk te zijn maar dankzij MacPorts volstond 1 regeltje:
$ sudo port install git-core
Maak van je huidige map en git-project.
$ git init
Alle andere commando’s die je vanaf nu uitvoert zijn in deze map.
$ git status
$ git add filename.ext
$ git add *
$ git commit -m "Dit is mijn boodschap"
$ git push -u origin master
$ git pull git@github.com:Username/project.git
$ git fetch git@github.com:Username/project.git
$ git clone git@github.com:Username/project.git
git mergetool
It opens a GUI that steps you through each conflict and you get to choose how to merge. Sometimes it requires a bit of hand editing afterwards, but usually it’s enough by itself. Much better than doing the whole thing by hand certainly
cd /path/to/my/repo
git remote add origin ssh://git@bitbucket.org/username/projectname.git
git push -u origin –all # pushes up the repo and its refs for the first time
git push -u origin –tags # pushes up any tags
git remote -v
git remote rm destination
# Remove remote
doe hem dan terug weg
git reset HEAD@{1}
git stash list
git stash drop