Moved some secions from basic.txt to clone.txt
[gitmagic/gitmagic.git] / clone.txt
blob356bca4aea8d6cb57ebcb8024c01d8b40732158f
1 = Cloning Around =
3 In older version control systems, checkout was the standard way to get a saved state. On checkout, you'd get a bunch of files in the requested saved state.
5 In Git, the standard way to get files is to create a clone of the entire repository. In other words, you practically create a mirror of the central repository, so you can do anything the central repostiory can do.
7 == Sync Computers ==
9 This is the reason I first used Git. I can tolerate making tarballs or using <tt>rsync</tt> for backups. The problem was sometimes I'd edit on my laptop, other times on my desktop, and they may not have talked to each other in between.
11 Initialize a Git repository and commit your files as above on one machine. Then on the other:
13  $ git-clone other.computer:/path/to/files
15 to create a second copy of the files and Git respository. From now on,
17  $ git-commit -a
18  $ git-pull other.computer:/path/to/files
20 will pull in the state of the files on the other computer into the one you're working on. If you've recently made conflicting edits in the same file, Git will let you know and you should commit again after resolving them.
22 If you have not committed any changes on the other computer, you may type
24  $ git-push other.computer:/path/to/files
26 to push the current state to the other computer. Next time you're logged in to the other computer, run
28  $ git-checkout HEAD .
30 to update the files before working on them. Be aware that you'll lose any uncommitted changes after.
32 == Classic Source Control ==
34 Copy your project to a directory in your main server. Initialize a Git
35 repository: <tt>git init ; git add . ; git commit -m "Initial commit"</tt>.
37 To check out source, a developer types
39  $ git clone main.server:/path/to/files
41 After making changes, the code is checked in to the main server by:
43  $ git commit -a
44  $ git push
46 If the main server has been updated, the latest version needs to be checked out before the push. To sync to the latest version:
48  $ git commit -a
49  $ git pull
51 == Forking a Project ==
53 Sick of the way a project is being run? Think you could do a better job?
55 First, on your server:
57  $ git clone main.server:/path/to/files
59 Then tell everyone to check out your fork of the project at your server.
61 At any later time, you can merge in the changes from the original project with:
63  $ git pull
65 == Ultimate Backups ==
67 How would you like multiple tamper-proof geographically diverse redundant archives?
69 TODO
71 == Guerilla Version Control ==
73 TODO
75 == Working On Features In Parallel ==
77 TODO
79 == Source Control Engine Tools and Utilities ==
81 TODO