Upload
craftworkz
View
141
Download
0
Embed Size (px)
Citation preview
Version Control● Samenwerken op 1 project
● Teruggaan naar vorige versie
● Aanpassingen vergelijken
● Commit history
● Door Linus Torvalds in 2005
● Alternatief voor Bitkeeper
● Volledig file-based
● Huidige version: 2.4.5
git config --global user.name “Andy Van Den Heuvel”git config --global user.email “[email protected]”
Stel gebruikersinfo in
git config --global http.proxy “http://proxy.server.com:8080”git config --global https.proxy “https://proxy.server.com:8080”
Stel proxy in
mkdir ucllcd ucllgit initecho ‘puts “Hello world”’ > hello.rbgit add hello.rbgit commit -m “Initial commit”
Start git project
echo ‘puts “Hello Craftworkz”’ > hello.rbgit status -sgit diffgit add hello.rbgit commit -m “update greeting”
Maak aanpassingen
echo “Temporary file” > tmpfilegit status -secho “tmpfile” > .gitignoregit add .gitignoregit commit -m “add gitignore”git status -s
Negeer bestanden
Github
● Best place to share code!
● 9M gebruikers
● 21M repositories
“GitHub was born into a world where there was no existing market for paid Git hosting. We would be creating the market. I vividly remember telling people, “I don’t expect GitHub to succeed right away”
-- Tom Preston-Werner
git clone https://github.com/andyvdh/remotedemo.git
git remote -v
Clone Repository
echo “# Hello Remote 3” > README.md
git add README.md
git commit -m “update readme”
git push
Push naar remote server
Werk verder op branch
echo ‘puts "Hello World"’> hello.rb
git add hello.rb
git commit -m “add greeting”
Werk verder op master
echo ‘puts "Hello Craftworkz"’ > hello.rb
git add hello.rb
git commit -m “add new hello world”
Samenvatting
● Leer de Command Line tool
● Gebruik altijd .gitignore file
● Push zaken die samenhoren, geef duidelijke commit messages
Best practices
● Check-in code min. 1x per dag
● Wees niet bang van branches
● Herschrijf de geschiedenis niet
Links● http://www.git-scm.com● http://www.github.com● http://try.github.io● http://www.bitbucket.com● https://hub.jazz.net● http://stackoverflow.com/questions/tagged/git● http://gitref.org● https://about.gitlab.com● https://www.atlassian.com/software/sourcetree/overview● https://www.gerritcodereview.com
Videos● https://www.parleys.com/tutorial/advanced-git-github
● https://www.youtube.com/watch?v=vDv5K5PbvO8
● https://www.youtube.com/watch?v=73I5dRucCds
● http://www.infoq.com/presentations/git-index
● https://www.codeschool.com/courses/git-real
Books
Pro Githttps://git-scm.com/book/en/v2
(Gratis)Pragmatic Guide To Git Git in Practice
Credits● https://upload.wikimedia.org/wikipedia/commons/c/cc/Linus_Torvalds_flipped.jpg● https://upload.wikimedia.org/wikipedia/commons/c/cb/Salix_cinerea_subsp._oleifolia_branch.jpg● https://upload.wikimedia.org/wikipedia/commons/a/a1/Rusty_tools.JPG