GitHub实战系列汇总:http://www.cnblogs.com/dunitian/p/5038719.html

——————————————————————————————————————————————————————

很多人问,明明有git gui 和 github可以直接图形化操作的吗?全部指令干啥???

呃(⊙o⊙)…呃(⊙o⊙)… ===> 装逼~

O(∩_∩)O~,开玩笑的,其实就是为了通用和熟悉git,linux里面照样这样用,多熟悉点基础指令很有用的,

如果觉得顿时不开心了、无爱了==>推荐你快速入门:http://www.imooc.com/learn/390

———————————————————————————————————————————————————————

创建项目的时候在最下面,添加过滤器,选择vs 或者把 .gitignore 拷贝一份放git项目文件夹的根目录

建完就有两个文件了,.gitignore 是过滤文件

补充:在windows里面直接建立这个文件是不行的,windows最后一个.前面必须有名字(linux里面有.号开头的文件),除了拷贝再介绍一个方法:

进github,单击 New File 然后把最下面的过滤文件加进去(ssh的左边第一个按钮)

vs的过滤规则贴一下:

 ## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. # User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates # User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs # Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/ # Visual Studo cache/options directory
.vs/ # MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.* # NUNIT
*.VisualState.xml
TestResult.xml # Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c *_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc # Chutzpah Test files
_Chutzpah* # Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile # Visual Studio profiler
*.psess
*.vsp
*.vspx # TFS Local Workspace
$tf/ # Guidance Automation Toolkit
*.gpState # ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user # JustCode is a .NET coding addin-in
.JustCode # TeamCity is a build add-in
_TeamCity* # DotCover is a Code Coverage Tool
*.dotCover # NCrunch
_NCrunch_*
.*crunch*.local.xml # MightyMoose
*.mm.*
AutoTest.Net/ # Web workbench (sass)
.sass-cache/ # Installshield output folder
[Ee]xpress/ # DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html # Click-Once directory
publish/ # Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj # NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config # Windows Azure Build Output
csx/
*.build.csdef # Windows Store app package directory
AppPackages/ # Others
*.[Cc]ache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
bower_components/ # RIA/Silverlight projects
Generated_Code/ # Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm # SQL Server files
*.mdf
*.ldf # Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings # Microsoft Fakes
FakesAssemblies/ # Node.js Tools for Visual Studio
.ntvs_analysis.dat # Visual Studio build log
*.plg # Visual Studio workspace options file
*.opt

扩展:(可以自己添加过滤文件/规则)

忽略文件

一般我们总会有些文件无需纳入 Git 的管理,也不希望它们总出现在未跟踪文件列表。 通常都是些自动生成的文件,比如日志文件,或者编译过程中创建的临时文件等。 在这种情况下,我们可以创建一个名为 .gitignore 的文件,列出要忽略的文件模式。 来看一个实际的例子:

$ cat .gitignore
*.[oa]
*~

第一行告诉 Git 忽略所有以 .o 或 .a 结尾的文件。一般这类对象文件和存档文件都是编译过程中出现的。 第二行告诉 Git 忽略所有以波浪符(~)结尾的文件,许多文本编辑软件(比如 Emacs)都用这样的文件名保存副本。 此外,你可能还需要忽略 log,tmp 或者 pid 目录,以及自动生成的文档等等。 要养成一开始就设置好 .gitignore 文件的习惯,以免将来误提交这类无用的文件。

文件 .gitignore 的格式规范如下:

  • 所有空行或者以  开头的行都会被 Git 忽略。

  • 可以使用标准的 glob 模式匹配。

  • 匹配模式可以以(/)开头防止递归。

  • 匹配模式可以以(/)结尾指定目录。

  • 要忽略指定模式以外的文件或目录,可以在模式前加上惊叹号(!)取反。

所谓的 glob 模式是指 shell 所使用的简化了的正则表达式。 星号(*)匹配零个或多个任意字符;[abc]匹配任何一个列在方括号中的字符(这个例子要么匹配一个 a,要么匹配一个 b,要么匹配一个 c);问号(?)只匹配一个任意字符;如果在方括号中使用短划线分隔两个字符,表示所有在这两个字符范围内的都可以匹配(比如 [0-9] 表示匹配所有 0 到 9 的数字)。 使用两个星号(*) 表示匹配任意中间目录,比如`a/**/z` 可以匹配 a/za/b/z 或 `a/b/c/z`等。

最新文章

  1. RedHat下安装Telnet服务端及客户端远程连接配置
  2. fir.im Weekly - 当技术成为一种 “武器”
  3. Orchard 异常
  4. jQurey 获取当前时间
  5. SharePoint API测试系列——对Recorded Item做OM操作(委托的妙用)
  6. c++ break while
  7. ios开发小技巧之摇一摇截屏
  8. android Fragments详解六:处理fragement的生命周期
  9. 每天一个JavaScript实例-从一个div元素删除一个段落
  10. 制作SSL证书
  11. App Store生存指南
  12. 基础知识——Cocos2d-x学习历程(三)
  13. Android之判断设备网络连接状态,并判断连接方式
  14. IOS的自定义控件
  15. SuperSocket 最基础入门
  16. TCP三次握手与四次分手超简单解析
  17. centos7 卸载 jdk
  18. IronPython初体验
  19. python安装虚拟环境pipenv
  20. BizDevOps — the true value proposition of workflow engines

热门文章

  1. JavaScript进阶之路(一)初学者的开始
  2. C++中的事件分发
  3. 探索ASP.NET MVC5系列之~~~2.视图篇(上)---包含XSS防御和异步分部视图的处理
  4. input[tyle="file"]样式修改及上传文件名显示
  5. 个人网站对xss跨站脚本攻击(重点是富文本编辑器情况)和sql注入攻击的防范
  6. ASP.NET Core 中文文档 第四章 MVC(3.7 )局部视图(partial)
  7. Spring获取ApplicationContext
  8. window7系统怎么找到开始运行命令
  9. nginx启动报错:/usr/local/nginx/sbin/nginx: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
  10. C 盘的不速之客