Contenu connexe Similaire à Effective Git (20) Plus de Konrad Malawski (20) Effective Git6. is also
fast
reliable
powerful
popular
8. • it is too new
• not tested
• does not provide backups (sic!)
• does not like windows
• does not support ...
• it's not subversion
9. Git is "simple" but hard.
Subversion is "easy", but eventually complex.
Thomas Nicolaisen
(http://blog.tfnico.com/2011/11/some-thoughts-on-git-vs-complexity.html)
10. git config --global user.name Sheldon Cooper
git config --global user.email bazinga@bigbang.com
git config --global color.ui true
13. • cherry-pick
• rebase (interactive)
• interactive add
• submodules
• git svn
• git sh
18. # initialize a submodule
git submodule add git://llp.pl/common.git common
# initial pull of it's contents
git submodule init
# pull pointed to commit (and overwrite your changes)
git submodule update
20. cd common
git pull
cd ..
# Warning! Add the dir without trailing "/”
git add common
git commit -m "Latest common submodule commit"
34. Or expose full details, for developers only
@Inject
GitRepositoryState repoState;
@GET
@Path("/git")
public GitRepositoryState getRepoState()
{
return repoState;
}
{ "branch" : "testing-maven-git-plugin",
"commitTime" : "06.01.1970 @ 16:16:26 CET",
"commitId" :
"787e39f61f99110e74deed68ab9093088d64b969",
"commitIdAbbrev" : "787e39f", "commitUserName" :
"Konrad Malawski", "commitUserEmail" :
"konrad.malawski@java.pl", "commitMessageFull" :
"releasing my fun plugin :-) + fixed some typos +
cleaned up directory structure + added license etc",
"commitMessageShort" : "releasing my fun plugin :-)",
"buildTime" : "06.01.1970 @ 16:17:53 CET",
"buildUserName" : "Konrad Malawski",
"buildUserEmail" : "konrad.malawski@java.pl" }
36. De facto standard of viewing git-based repositories
Just point it to the repo
Works through Apache and CGI
38. online code review
(like ReviewBoard, but better ;-))
also hosts git repositories
review commits before they enter a branch
39. with some help
by the power of Jenkins,
allows to have pre-tested commits