Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

git submodules - Git error: Changes not staged for commit

I have my project + RestKit submodule. Error appeared when I changed RestKit settings. I added support armv6 and armv7 architecture.

git add .
git add -u 
git commit -m "new"
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#   (commit or discard the untracked or modified content in submodules)
#
#   modified:   RestKit (modified content)
#

How to fix this error.

UPDATE: I don't run git add RestKit.

UPDATE2: The strusture of my project is:

enter image description here

I added submodule as

git submodule update -i
See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

You are apparently dealing with a submodule, so you should use the submodule workflow :

# Modification on RestKit, for instance :
cd RestKit
git add .
git commit -m "Support for armv6 & armv7"
cd ..
# RestKit submodule up-to-date, now update your project
git add RestKit
git commit -m "RestKit submodule updated"

You can find more information here.

Also : Git Book on Submodules


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...