Source Control Management

Version 69 (Sickboy, 02/09/2009 13:41)

1 1 Sickboy
{{>toc}}
2 50 Sickboy
3 50 Sickboy
h1. SCM
4 1 Sickboy
5 1 Sickboy
Please click "Wiki" in the menu above for generic dev-heaven site help
6 15 kju
7 15 kju
*GENERAL NOTE* This wiki is based on the "Exception" rule. Please leave settings/configuration options default, unless it is explicitly listed to do otherwise.
8 1 Sickboy
9 14 kju
h2. Private and Public Key Files
10 2 Sickboy
11 1 Sickboy
To connect to a dev-heaven.net ssh host, you must authenticate with a private/public key combination.
12 61 Sickboy
Please follow the following steps to generate keys, and get access.
13 1 Sickboy
14 1 Sickboy
h3. Installation
15 1 Sickboy
16 35 Sickboy
* Install "Putty Suite":http://tartarus.org/~simon/putty-snapshots/x86/putty-installer.exe
17 37 Sickboy
* Create a Key Set with PuttyGen
18 33 Sickboy
* Save the PUBLICkey and PRIVATEkey somewhere safe on your harddrive
19 35 Sickboy
* Send PUBLICkey to admin (Guard the PRIVATEkey with your life, never share! :D)
20 36 Sickboy
** The admin will give your account the permission to the right project, and supply you with the git clone url
21 1 Sickboy
22 1 Sickboy
h3. (After any reboot) if you want to access a dev-heaven.net ssh host:
23 1 Sickboy
24 1 Sickboy
* Load your PRIVATEkey into the PageAnt application (Part of putty suite). 
25 38 Sickboy
_Incase you have a password on the PRIVATEkey, you will have to enter this everytime pageant loads your key_
26 34 Sickboy
* You are recommended to add a link to autostart with the param(s) to you key file(s).
27 7 kju
<pre>
28 41 kju
D:\Programme\Putty\pageant.exe "D:\Programme\Putty\my_private_key.ppk"
29 7 kju
</pre>
30 51 Sickboy
31 47 Sickboy
h3. First time connecting to a host
32 1 Sickboy
33 9 kju
** Open a connection with putty, to the host (e.g: git.dev-heaven.net) *DO NOT* save it!
34 1 Sickboy
*** Click YES/Accept to accept the server key
35 1 Sickboy
*** Close Putty again
36 1 Sickboy
** You should only have to do this once per host
37 47 Sickboy
38 1 Sickboy
39 45 Sickboy
h1. GIT
40 1 Sickboy
41 45 Sickboy
h2. Installation of the Core Client (MSysGit)
42 20 Sickboy
43 24 Sickboy
* (Make sure the Putty suite is installed, see top of page)
44 40 Sickboy
* Install "MSysGit":http://dev-heaven.net/projects/list_files/heaven (*Fixed Edition!* Please lookup the latest available version)
45 1 Sickboy
** It is recommended to add the Windows Explorer Extensions ("Git Gui Here", "Git Bash Here")
46 1 Sickboy
** Choose to install for *Windows Command Line* (Middle option, out of 3)
47 1 Sickboy
** Choose to use *Plink for SSH*
48 44 Sickboy
49 45 Sickboy
h2. Installation of the Interface Client(s)
50 44 Sickboy
51 52 Sickboy
There are several clients available, you can choose to use 1, or a combination of them, as you wish.
52 52 Sickboy
53 45 Sickboy
h3. Git GUI
54 44 Sickboy
55 60 Sickboy
This is part of the MsysGit Installation
56 60 Sickboy
"*Usage Help, Examples and Screenshots*":http://dev-heaven.net/wiki/heaven/Git_Gui_Guide
57 44 Sickboy
58 59 Sickboy
59 45 Sickboy
h3. Git Extensions
60 44 Sickboy
61 44 Sickboy
This client is a bit like Tortoise's client, but operates a bit differently and has a few unique features
62 56 Sickboy
* Install "Git Extensions":http://downloads.sourceforge.net/gitextensions/GitExtensions138Setup.msi?use_mirror=
63 1 Sickboy
** If you install the *Complete* Setup, please *do not* install the included MSysGit with it!!
64 1 Sickboy
** Choose to install KDiff (Only available in *Complete* Setup). You can also download & install this application seperately (google)
65 1 Sickboy
** Incase of 64-bit Windows (otherwise skip this step!), if you also want to use the Extensions in 32-bit applications (like Total Commander);
66 1 Sickboy
*** also download the .zip file
67 1 Sickboy
*** unpack the GitExtensionsShell.dll
68 33 Sickboy
*** rename it to GitExtensionsShellEx32.dll
69 39 Sickboy
*** place it in your Git Extensions installation folder
70 1 Sickboy
*** regsvr32 GitExtensionsShellEx32.dll from a dos prompt
71 1 Sickboy
* *Please Reboot*
72 1 Sickboy
* Startup the Git Extensions application, and verify that all settings are filled in. (Local Settings tab can remain empty)
73 1 Sickboy
** UserName
74 1 Sickboy
** E-mail
75 1 Sickboy
** Application Locations
76 1 Sickboy
** Favorite Editor and Diff/Merge program
77 1 Sickboy
78 58 Sickboy
"*Usage Help, Examples and Screenshots*":http://dev-heaven.net/wiki/20/GitExtensions_QuickStart
79 1 Sickboy
80 59 Sickboy
81 55 Sickboy
h3. TortoiseGit
82 55 Sickboy
83 55 Sickboy
_experimental!_
84 55 Sickboy
This client is basically TortoiseSVN but then for Git, and is very much alike the SVN version
85 55 Sickboy
86 55 Sickboy
* *BETTER NOT USE UNTIL FURTHER DEVELOPED*
87 1 Sickboy
88 67 Sickboy
h3. Handy Scripts / Tools
89 63 Sickboy
90 65 Sickboy
* "Git Remote Branching":http://github.com/webmat/git_remote_branch/tree/master Very useful script written in Ruby. Can be used to simplify managing remote branches. (create, track or remove)
91 59 Sickboy
92 67 Sickboy
h2. First Step: Cloning a repository
93 1 Sickboy
94 1 Sickboy
* Please make sure your keyAgent (e.g Pageant) is running, and your private key is loaded
95 59 Sickboy
* Use interface or commandline git and clone your first repository: git clone git@git.dev-heaven.net:REPOSITORYNAME.git  (Receive repository name from admin)
96 59 Sickboy
** In case of message: "The server's host key is not cached in the registry. You have no guarantee that the server is the computer you think it is.", press y. Incase that doesn't work, first connect once to the host with Putty, and accept the hostkey.
97 1 Sickboy
98 1 Sickboy
99 45 Sickboy
h2. JumpStart
100 1 Sickboy
101 1 Sickboy
* In Git, you have a local copy of the repository
102 1 Sickboy
* If you commit, you only commit to your local repository. If you want to push your changes to the shared remote repository, you must first git pull, and then git push
103 1 Sickboy
* If you wish to fetch, you use git pull
104 1 Sickboy
* If there are things to merge, like changes to files by 2 persons, use git merge
105 9 kju
* every git command can be used with --help for basic help output
106 1 Sickboy
107 1 Sickboy
* First useful "git cheat sheet":http://cheat.errtheblog.com/s/git/
108 1 Sickboy
* "Subversion commands in git ":http://git.or.cz/course/svn.html
109 1 Sickboy
110 1 Sickboy
111 68 Sickboy
112 67 Sickboy
h2. Information Resources
113 66 Sickboy
114 66 Sickboy
Here we save all additional information and links we find
115 66 Sickboy
116 45 Sickboy
h3. Staging and Committing Changes
117 1 Sickboy
118 1 Sickboy
* If you have Git Extensions installed and properly setup, you can right click a repository and choose "Git Extensions" -> "Browse"
119 1 Sickboy
** You can use this tool to browse the repository+history
120 1 Sickboy
** You can use the "Commit" option in this tool to stage your changes and commit. It works pretty handy with the rescan changes button and other options
121 1 Sickboy
122 45 Sickboy
h3. Reverting Uncommitted Changes
123 1 Sickboy
124 1 Sickboy
* By using the Git Extensions: Browse. Then Commit
125 1 Sickboy
* If your file is already stage, unstage it
126 1 Sickboy
* Right click the file in the top file list, and choose revert changes
127 1 Sickboy
* There are more ways, like hard resetting to current head: git checkout -f (Or in the Commit dialog of Git Extensions: reset changes hard), however, this will revert ALL your currently uncommitted changes
128 1 Sickboy
129 66 Sickboy
h3. Common problems
130 6 kju
131 6 kju
<pre>
132 6 kju
Access denied
133 6 kju
FATAL ERROR: Server sent disconnect message
134 6 kju
type 2 (protocol error):
135 6 kju
"Too many authentication failures for git"
136 6 kju
</pre>
137 6 kju
138 6 kju
Usually happens when pageant aint running.
139 6 kju
Or when you installed msysgit without pointing it to putty plink.
140 6 kju
141 11 kju
<pre>
142 11 kju
You asked me to pull without telling me which branch you
143 11 kju
want to merge with, and 'branch.master.merge' in
144 11 kju
your configuration file does not tell me either.  Please
145 11 kju
name which branch you want to merge on the command line and
146 11 kju
try again (e.g. 'git pull <repository> <refspec>').
147 69 Sickboy
....
148 11 kju
</pre>
149 11 kju
150 11 kju
Use: git pull origin master
151 11 kju
(or push)
152 17 Sickboy
153 23 Sickboy
Or setup the mentioned settings (execute from your repository folder):
154 69 Sickboy
* git config branch.master.remote origin
155 69 Sickboy
* git config branch.master.merge refs/heads/master
156 1 Sickboy
157 1 Sickboy
158 66 Sickboy
h3. Links
159 1 Sickboy
160 42 Sickboy
* DevHeaven Git Discussion: http://dev-heaven.net/boards/1/topics/show/15
161 1 Sickboy
* Git: http://git-scm.com/
162 17 Sickboy
* Git <-> SVN Linked together: http://flavio.castelli.name/howto_use_git_with_svn
163 2 Sickboy
* Why Better: http://whygitisbetterthanx.com/
164 1 Sickboy
* GitFaq: http://git.or.cz/gitwiki/GitFaq
165 1 Sickboy
* GitHub: http://www.github.com
166 1 Sickboy
* Gitorious: http://gitorious.org/
167 1 Sickboy
* GitEnabled Pastebin: http://gist.github.com
168 1 Sickboy
* http://peepcode.com/products/git
169 1 Sickboy
* http://jfcouture.com/category/git/
170 43 Sickboy
* http://blog.carlmercier.com/2008/01/25/no-nonsense-git-part-1-git-remote-branch/
171 24 Sickboy
* http://github.com/webmat/git_remote_branch
172 24 Sickboy
173 66 Sickboy
h3. Experimental Clients
174 24 Sickboy
175 24 Sickboy
* "NetBeans Git Plugin":http://www.nbgit.org (This is only a wrapper, you still require a Git Implementation (MSYS/CygWin))
176 1 Sickboy
177 45 Sickboy
h1. Subversion (SVN)
178 1 Sickboy
179 1 Sickboy
* Please make sure your keyAgent (e.g Pageant) is running, and your private key is loaded
180 1 Sickboy
* DevHeaven Url: svn.dev-heaven.net
181 1 Sickboy
182 2 Sickboy
h1. Virtual Folders / Working with Repositories in ArmA
183 1 Sickboy
184 1 Sickboy
* Vista mklink: http://itsvista.com/2007/03/mklink/
185 1 Sickboy
* http://en.wikipedia.org/wiki/NTFS_junction_point
186 1 Sickboy
* http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html