Mercurial 初学者:权威实用指南 [英] Mercurial for Beginners: The Definitive Practical Guide

查看:21
本文介绍了Mercurial 初学者:权威实用指南的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

灵感来自 Git 初学者:权威实用指南.

这是关于初学者实际使用Mercurial的信息汇编.

This is a compilation of information on using Mercurial for beginners for practical use.

初学者 - 接触过源代码控制但不太了解的程序员.

Beginner - a programmer who has touched source control without understanding it very well.

实用 - 涵盖大多数用户经常遇到的情况 - 创建存储库、分支、合并、从/向远程存储库拉/推等.

Practical - covering situations that the majority of users often encounter - creating a repository, branching, merging, pulling/pushing from/to a remote repository, etc.

注意事项:

  • 解释如何完成某事而不是如何完成某事实施.
  • 每个答案处理一个问题.
  • 尽可能简洁明了地回答.
  • 编辑/扩展现有答案,而不是在相同的主题.
  • 请提供指向 Mercurial wikiHG Book 适合想要了解更多信息的人.
  • Explain how to get something done rather than how something is implemented.
  • Deal with one question per answer.
  • Answer clearly and as concisely as possible.
  • Edit/extend an existing answer rather than create a new answer on the same topic.
  • Please provide a link to the the Mercurial wiki or the HG Book for people who want to learn more.

问题:

  • Mercurial: The Definitive Guide
  • Mercurial Wiki
  • Meet Mercurial | Peepcode Screencast
  • Mastering Mercurial | TekPub Screencast
  • Hg Init - ground-up Mercurial tutorial

推荐答案

如何配置忽略文件?

Ignore 配置在存储库根目录中名为 .hgignore 的普通文本文件中.像普通文件一样添加它:

How do you configure it to ignore files?

Ignore is configured in a normal text file called .hgignore in the root of your repository. Add it just like a normal file with:

hg add .hgignore

有两种语法选项可用于文件匹配,glob 和 regexp.glob 是类 unix 的文件名扩展,regexp 是正则表达式.您可以通过在一行上单独添加 syntax: globsyntax: regexp 来激活每个.接下来的所有行都将使用该语法,直到下一个语法标记.您可以根据需要拥有任意数量的语法标记.默认语法是 regexp,因此如果您只使用 regexp,则不需要任何语法标记.

There are two syntax options available for file matching, glob and regexp. glob is unix-like filename expansion and regexp is regular expressions. You activate each by adding syntax: glob or syntax: regexp on a line by itself. All lines following that will use that syntax, until the next syntax marker. You can have as many syntax markers as you want. The default syntax is regexp, so if you only use regexp you don't need any syntax marker.

你可以用#添加评论

示例:

# python temporary files
syntax: glob
*.pyc

#editor autosaves
*~

# temporary data
syntax: regexp
temp

忽略仅适用于非托管文件(即尚未签入的文件).要忽略受版本控制的文件,您可以使用开关 -I 和 -X.

Ignore only applies to unmanaged files (i.e. files that are not already checked in). To ignore files that are under version control, you can use the switches -I and -X.

这篇关于Mercurial 初学者:权威实用指南的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆