3 git-fc is a friendly fork of Git, which means it's a fork that won't deviate
4 from the mainline; it is more like a branch in Git terms. This branch will move
5 forward close to Git's mainline, and it could be merged at any point in time,
6 if the maintainer wished to do so.
8 git-fc doesn't include experimental code, or half-assed features, so you can
9 expect the same level of stability as Git's mainline. Also, it doesn't remove
10 any feature, or do any backwards incompatible changes, so you can replace git
11 with git-fc and you wouldn't notice the difference. The difference comes in the
12 extra features, that is all.
16 Each release of Git is merged directly into git-fc, so if there's a new feature
17 in Git, git-fc will get it as well.
19 Every extra feature is maintained individually in a separate branch, so if you
20 are interested in a specific feature and don't trust the rest of git-fc, you
21 can use that branch instead. For example the publish tracking branch feature is
22 maintained in the 'fc/publish' branch which sits on top of git.git's v1.9.2.
23 You can grab the specific branch and do whatever you want with it.
27 ### Streamlined remote helpers
29 `git-remote-hg` and `git-remote-bzr` are remote helpers that allow two-way
30 communication between Git and Mercurial/Bazaar. They have been proven to be
31 very reliable and solid, and used by many people. In order to use them in Git
32 mainline you might need a bit of tinkering.
34 With git-fc they are installed by default, and in the right way. Plus there are
35 fixes in the remote helper infrastructure so they always work better than in
38 ### New 'git update' tool
40 Everybody has agreed the `git pull` command is broken for most use-cases, which
41 is why most seasoned Git users avoid it, and it is recommended for new users to
44 A new tool is necessary for the most common use case, which is fetch all the
45 updates and update the current branch if possible.
47 The new `git update` will fast-forward to the latest commit in the remote
48 branch if there's no divergence (you haven't made extra commits). But if you
49 have made extra commits you will be told to either merge or rebase, or run `git
50 update --merge` or `git update --rebase`.
52 This ensures that new users won't be making merges by mistake.
54 Additionally, when doing a merge the order of the parents will be reversed, so
55 it would appear as if you are merging your local branch to the remote one, and
56 not the other way around like `git pull` does. Everybody has agreed this is a
57 problem with `git pull`.
59 ### Publish tracking branch
61 Git mainline doesn't have the greatest support for triangular workflows, a good
62 solution for that is to introduce a second "upstream" tracking branch which is
63 for the reverse; the branch you normally push to.
65 Say you clone a repository (libgit2) in GitHub, then create a branch
66 (feature-a) and push it to your personal repository, you would want to track
67 two branches (origin/master), and (mine/feature-a), but Git mainline only
68 provides support for a single upstream tracking branch.
70 If you setup your upstream tracking branch to 'origin/master', then you can
71 just do `git rebase` without arguments and git will pick the right branch
72 (origin/master) to rebase to. However, `git push` by default will also try to
73 push to 'origin/master', which is not what you want. Plus `git branch -v` will
74 show how ahead/behind your branch is compared to origin/master, not
77 If you set up your upstream to 'mine/feature-a', then `git push` will work, but
80 With this option, `git rebase` uses the upstream branch, and `git push` uses
83 Setting the upstream tracking branch is easy:
85 git push --set-publish mine feature-a
89 git branch --set-publish mine/feature-a
91 And `git branch -v` will show it as well:
94 fc/branch/fast 177dcad [master, gh/fc/branch/fast] branch: ...
95 fc/stage abb6ad5 [master, gh/fc/stage] completion: ..
96 fc/transport/improv eb4d3c7 [master, gh/fc/transport/improv] ...
99 ### Official staging area
101 Everybody already uses the term "staging area" already, and Git developers also
102 agreed it the best term to what is officially referred to as "the index". So
103 git-fc has new options for all commands that modify the staging area (e.g. `git
104 grep --staged`, `git rm --staged`), and also adds a new `git stage` command
105 that makes it easier to work with the staging area.
108 'git stage' [options] [--] [<paths>...]
109 'git stage add' [options] [--] [<paths>...]
110 'git stage reset' [-q|--patch] [--] [<paths>...]
111 'git stage diff' [options] [<commit>] [--] [<paths>...]
112 'git stage rm' [options] [--] [<paths>...]
113 'git stage apply' [options] [--] [<paths>...]
117 Without any command, `git stage` adds files to the stage, same as `git add`, same as in Git mainline.
121 Currently `git branch -v` will show you the tracking status (ahead/behind), but
122 wouldn't show you which from which branch, and it takes considerable amount of
123 time (compared to most Git commands).
125 This is fixed so the branch is showed instead, which is more useful and faster.
126 If you want the tracking status, you can use `git branch -vv` which shows
127 everything, as with Git mainline.
130 fc/branch/fast 177dcad [master] branch: ...
131 fc/stage abb6ad5 [master] completion: ...
132 fc/transport/improv eb4d3c7 [master] transport-helper: ...
137 Many (if not all) version control system tools have shortcuts for their most
138 common operations; `hg ci`, `svn co`, `cvs st`, but not Git... git-fc does:
148 If you have already these aliases, or mapped to something else, your aliases
149 would take precedence over the default ones, so you won't have any problems.
151 ### New core.mode configuration
153 The behavior of Git v2.0 is already being defined, but there's no way to test
154 it, if you want to test it, along with all future behaviors, you can enable it
155 on git-fc by setting the configuration `core.mode = next`.
157 In addition to the "next" (v2.0) mode, there's the "progress" mode. This mode
158 enables "next" plus other configurations that are saner.
160 It is recommended that you setup this mode for git-fc:
162 git config --global core.mode progress
164 ### New fetch.default configuration
166 When you have configured the upstream tracking branch for all your branches,
167 you will probably have tracking branches that point to a local branch, for
168 example 'feature-a' pointing to 'master', in which case you would get something
174 * branch master -> FETCH_HEAD
177 Which makes absolutely no sense, since the '.' repository is not even
178 documented, and FETCH_HEAD is a marginally known concept. In this case `git
179 fetch` is basically doing nothing from the user's point of view.
181 So the user can configure `fetch.default = simple` to get a simple sensible
182 default; `git fetch` will always use 'origin' by default.
184 If you use the "progress" mode, this option is also enabled.
188 There is partial optional support for Ruby. Git already has tooling so any
189 language can use it's plumbing and achieve plenty of tasks:
192 IO.popen(%w[git for-each-ref]) do |io|
194 sha1, kind, name = line.split()
200 However, this a) requires a process fork, and b) requires I/O communication to
201 get the desired data. While this is not a big deal on many systems, it is in
202 Windows systems where forks are slow, and many Git core programs don't work as
203 well as they do in Linux.
205 Git has a goal to replace all the core scripts with native C versions, but it's
206 a goal only in name that is not actually pursued. In addition, that still
207 leaves out any third party tools since Git doesn't provide a shared libgit
208 library, which is why an independent libgit2 was needed in the first place.
210 Ruby bindings solve these problems:
213 for_each_ref() do |name, sha1, flags|
218 The command `git ruby` can use this script by providing the bindings for many
219 Git's internal C functions (though not all), which makes it easier to write
220 Ruby programs that take full advantage of Git without any need of forks, or I/O
225 All these patches were written by me, Felipe Contreras, but contributions from
226 other people are welcome, as long as they follow these guidelines:
228 1. Follows Git coding guidelines and is technically correct according to Git
230 2. Doesn't break backwards compatibility
231 3. It doesn't conflict with other Git features so it can be rebased on newer
232 versions of Git without much maintenance burden
234 Patches should be sent using `git send-email` to the mailing list git-fc@googlegroups.com.