Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1489076
  • 博文数量: 226
  • 博客积分: 3997
  • 博客等级: 少校
  • 技术积分: 2369
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-19 17:26
个人简介

Never save something for a special occasion. Every day in your life is a special occasion.

文章分类

全部博文(226)

文章存档

2018年(5)

2017年(11)

2016年(1)

2015年(17)

2014年(14)

2013年(30)

2012年(5)

2011年(52)

2010年(107)

分类: Windows平台

2017-09-27 16:35:57

SourceInsight大项目添加文件列表 AddFromList

问题:
TI motorware 项目代码按模块组织,目录层次多,文件分散。在建立SourceInsight工程时,
手工添加这么多文件是不实现的,有什么方法批量添加需要的文件呢?

分析:
哪些是需要的文件?提交到git的文件是需要的,具体见.gitignore (只保留 28027F、foc、32b 相关文件)。

解决:
先利用git得到需要添加的文件列表。
// git ls-files --full-name | sed 's\^\c:/ti/motorware/motorware_1_01_00_13/sw/&\' > t.txt
git ls-files --full-name | awk -v prefix=`pwd` '/.[hc]$/{sub("^/c/","c:/",prefix); print prefix "/" $0}' > t.txt

然后执行 SourceInsight 菜单 Add and Remove Project Files...(M)/Add from List 即可。


REF:

List files in local git repo? - Stack Overflow

This command:
// git ls-tree --full-tree -r HEAD
lists all of the already committed files being tracked by your git repo.

Try this command:
git ls-files 
This lists all of the files in the repository, including those that are only staged but not yet committed.

sed在行首或者行尾添加内容 - 明之道 - 博客园
http://www.cnblogs.com/ITEagle/archive/2013/06/20/3145546.html

Unix awk 使用手册
~yhf/tutorial/awk_manual.html


阅读(5849) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~