﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Error-文章分类-git</title><link>http://www.cppblog.com/Error/category/20447.html</link><description /><language>zh-cn</language><lastBuildDate>Sat, 30 Mar 2013 06:55:49 GMT</lastBuildDate><pubDate>Sat, 30 Mar 2013 06:55:49 GMT</pubDate><ttl>60</ttl><item><title>最基本的命令git clone和最简单最有用的配置文件.gitignore，and 常用git配置</title><link>http://www.cppblog.com/Error/articles/198945.html</link><dc:creator>Enic</dc:creator><author>Enic</author><pubDate>Sat, 30 Mar 2013 05:57:00 GMT</pubDate><guid>http://www.cppblog.com/Error/articles/198945.html</guid><wfw:comment>http://www.cppblog.com/Error/comments/198945.html</wfw:comment><comments>http://www.cppblog.com/Error/articles/198945.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Error/comments/commentRss/198945.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Error/services/trackbacks/198945.html</trackback:ping><description><![CDATA[克隆远程git数据到本地<br />git clone [remoter git path] [destination path]<br /><br />配置git filter<br />emacs git_path/.gitignore<br />文件内容如下<br /><div><div>*.*</div><div></div><div>!*.c</div><div>!*.cpp</div><div>!*.txt</div><div>!*.hpp</div><div>!.inl</div><div>!.ipp</div><div>!*.cmake<br /><div>!.gitignore<br /><br />常用git配置</div></div></div><div>&nbsp;git config --list &nbsp;列出当前全部配置<br />///////////////////<br />git config 命令详解<br /><div><div>&nbsp;git config</div><div>usage: git config [options]</div><div></div><div>Config file location</div><div>&nbsp; &nbsp; --global &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;use global config file</div><div>&nbsp; &nbsp; --system &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;use system config file</div><div>&nbsp; &nbsp; --local &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; use repository config file</div><div>&nbsp; &nbsp; -f, --file &lt;file&gt; &nbsp; &nbsp; use given config file</div><div></div><div>Action</div><div>&nbsp; &nbsp; --get &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get value: name [value-regex]</div><div>&nbsp; &nbsp; --get-all &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get all values: key [value-regex]</div><div>&nbsp; &nbsp; --get-regexp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get values for regexp: name-regex [value-regex]</div><div>&nbsp; &nbsp; --replace-all &nbsp; &nbsp; &nbsp; &nbsp; replace all matching variables: name value [value_regex]</div><div>&nbsp; &nbsp; --add &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; adds a new variable: name value</div><div>&nbsp; &nbsp; --unset &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; removes a variable: name [value-regex]</div><div>&nbsp; &nbsp; --unset-all &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; removes all matches: name [value-regex]</div><div>&nbsp; &nbsp; --rename-section &nbsp; &nbsp; &nbsp;rename section: old-name new-name</div><div>&nbsp; &nbsp; --remove-section &nbsp; &nbsp; &nbsp;remove a section: name</div><div>&nbsp; &nbsp; -l, --list &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;list all</div><div>&nbsp; &nbsp; -e, --edit &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;opens an editor</div><div>&nbsp; &nbsp; --get-color &lt;slot&gt; &nbsp; &nbsp;find the color configured: [default]</div><div>&nbsp; &nbsp; --get-colorbool &lt;slot&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; find the color setting: [stdout-is-tty]</div><div></div><div>Type</div><div>&nbsp; &nbsp; --bool &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value is "true" or "false"</div><div>&nbsp; &nbsp; --int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value is decimal number</div><div>&nbsp; &nbsp; --bool-or-int &nbsp; &nbsp; &nbsp; &nbsp; value is --bool or --int</div><div>&nbsp; &nbsp; --path &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value is a path (file or directory name)</div><div></div><div>Other</div><div>&nbsp; &nbsp; -z, --null &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;terminate values with NUL byte</div></div><div></div>///////////////////<br />关于配置还可以更加直接一点，直接编辑.git/config文件<br />这里还有一个技巧就是配置remote url的时候<br /><div>https://[user name]:[pass world]@git01.codeplex.com/boostusingcmake<br />这样就相当于&#8220;记住帐号密码&#8221;<br /></div></div><img src ="http://www.cppblog.com/Error/aggbug/198945.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Error/" target="_blank">Enic</a> 2013-03-30 13:57 <a href="http://www.cppblog.com/Error/articles/198945.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>