git一次添加多个文件 [英] git add multiple files at once

查看:157
本文介绍了git一次添加多个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在源代码目录中有很多.c文件的项目,然后我做了这个项目,在项目里面有.o文件,我也想把这些文件推送到存储库,所以不是添加每个.o这是可能的,但...,如何轻松添加.o文件? 解决方案

一个可怕的想法,你可以添加他们作为任何其他文件:

  git add * .o 
git commit -m 提交编译的文件,这是不好的

当然不是 git add * .o 您可以使用 git add * / *。o 甚至 find -name * .o |同时阅读x;做git add $ x;完成


I had this project with a lot .c files in source directory,then I make the project, there is .o files inside of the project, I also want to push these files to repository,so instead of add each .o which is possible but...,how to add .o files easily?

解决方案

Putting aside the fact, that this is just a terrible idea, you can add them as any other file:

git add *.o
git commit -m "Committing compiled files, which is bad"

Of course instead of git add *.o you can use git add */*.o or even find -name *.o | while read x; do git add $x; done

这篇关于git一次添加多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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