background preloader

Git

Facebook Twitter

A Visual Git Reference. If the images do not work, you can try the Non-SVG version of this page.

A Visual Git Reference

SVG images have been disabled. (Re-enable SVG) This page gives brief, visual reference for the most common commands in git. Once you know a bit about how git works, this site may solidify your understanding. If you're interested in how this site was created, see my GitHub repository. A few git tips you didn't know about. Notice: some of these commands or flags require git version 1.7.2.

A few git tips you didn't know about

Git cheat sheets. 高飞鸟 – Highbird » Git. One of the difficult things for a git beginner to understand is how remote branches work.

高飞鸟 – Highbird » Git

Basically, as git is a distributed version control system, every developer has a full and independent repository. So, how can you pass changes around? In the examples below, we'll consider a remote repository, that we'll call origin, and a local one (that we'll call local). The remote repository has one branch, called master, that has been cloned as origin/master on the local repository. Moreover, the local repository has one local branch, called master as well (but it doesn't need to be), which is set up to track changes that happen on origin/master. The fetch operation (command git fetch) copies the latest commits from the master on origin to origin/master, and updates the HEAD of the origin/master branch: git fetch origin The circles on the schema (click for a larger version) represent commits, and the arrows are the parent->child relationship between commits.

Git svn - Delete a svn-Branch via git. Git svn - How do I tell git-svn about a remote branch created after I fetched the repo. Git 系列之二:Windows 下 Git 客户端的选择,及 msysGit 各种中文问题的解决-转载 - baizx. Git 系列之二:Windows 下 Git 客户端的选择,及 msysGit 各种中文问题的解决 在 Windows 下用 NetBeans 做 PHP 开发,首先想到的是 NetBeans 的插件:NBGit。

Git 系列之二:Windows 下 Git 客户端的选择,及 msysGit 各种中文问题的解决-转载 - baizx

评价:能用;若需没有的功能,可以自定义菜单调用自定义 bat 脚本;开发不活跃,使用没有信心。 第二个则是:TortoiseGit,SVN 小乌龟的 Git 版本。 评价:该有的功能基本都有了,还是不错的。 另外,TortoiseGit 只是 GUI 工具,使用它需要先安装 msysGit,这是正宗的 Git 之 Windows 版本。 选择:msysGit。 TortoiseGit 从功能上说是完善的,但它只是功能的堆砌而已,使用时完全体会不到 GUI 带来的便利。 Git、Gerrit与Jenkins/Hudson CI服务器. 本文讲述了如何为基于团队的代码审查系统配置Git、Gerrit与Jenkins/Hudson,正如我在《Git, Gerrit and Jenkins for iOS development》和《Gerrit Git Review with Jenkins CI Server》演讲(以及第一次提出这种做法的《Someday...》)中所倡导的那样。

Git、Gerrit与Jenkins/Hudson CI服务器

文中的范例假定你所使用的操作系统是OS X或Linux,但是如果你愿意,也可以在Windows上运行它们。 配置Git 很多系统(例如Linux)已经默认提供了Git,在Git主页也可以找到安装程序。 对于Windows用户,最好的选择是MsysGit。 请注意,如果你安装了Apple Developer Tools (for Xcode 4),那么其中已经自带Git二进制包了。 因为所有的Git提交都带有作者和电子邮件地址,如果你还没有设置过这些内容,请执行以下命令进行配置: $ git config --global user.name "Alex Blewitt" $ git config --global user.email Alex.Blewitt@example.com 最好有一个Git代码库。 如果还没有Git代码库,可以创建一个: git init --bare /path/to/gits/example.git Gerrit 可以从 Gerrit在运行时需要用到数据库(用于存储代码审查的信息)。 请注意,Gerrit 2.2.x正把项目配置、权限和其他元数据移到Git存储中,这样就可以通过Git进行访问和版本控制。 Git-svn-tutorial – Parrot. Import Straight from the SVN repo ¶ First, we need to fetch a copy of the repository. git svn clone -s -r 40000:HEAD # choose some recent-ish commit -s is for --stdlayout which presumes the svn recommended layout for tags, trunk, and branches.

git-svn-tutorial – Parrot

-r is for the revision to start taking history from. If you want to include all of the history, just leave that option off, but it will take a very long time, and you really don't need all of it. NOTE: The older a revision you choose, the longer it will take to import. This takes a clone of the repository at that revision; to update it to HEAD, you now need: My git svn workflow. Below are the steps I use when working with Git & SVN.

My git svn workflow

Please note, I am in no way a Git or SVN expert, but these are the steps that seem to work for me. 1) Checkout codebase This step only needs to be done once, it will pull down a local copy of the entire history allowing for very fast nagivation of revisions and allow work to be down when no connection to a central repository is available. Version control - Sparse checkout in Git 1.7.0. Git filter branch - Detach subdirectory into separate Git repository. Everyday GIT With 20 Commands Or So. SvnMigration. Table of contents: Moving an organisation from SVN to git involves convincing people to unlearn a lot of SVN stuff they're comfortable with, then learn a lot of new git stuff they don't understand.

SvnMigration

It takes several months of advocacy and education to move even a small team, and productivity will probably go down before it comes back up. This page presents some tools and tips to help migrate an organisation from SVN to git. If you just want to migrate yourself, you might prefer the crash course. At present, this page concentrates on command-line SVN and git users - contributions are welcome from people that have made the switch in a GUI environment.

A move to git generally starts with advocating it to the rest of your team. This stage is as much about promoting a healthy level of envy as making a logical argument. SVN users usually look at git's features with confusion or disinterest, except for the one thing they immediately identify as their killer app. GitTips. See also: GitFaq (Frequently Asked Questions) page.

GitTips

GitWorkflows which attempts to describe actual, useful, real-world things that people do with git, step by step. Planet Git.