Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
261 views
in Technique[技术] by (71.8m points)

git add multiple files at once

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?

question from:https://stackoverflow.com/questions/8412081/git-add-multiple-files-at-once

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...