Valery Lyalin
Valery Lyalin

Reputation: 91

Pushing changes in the git submodule

I have a problem with pushing changes in submodule repo.

add submodule add https://github.com/ikalnytskyi/termcolor.git
git add .
git commit -m "Add the new color submodule"

After that I made some changes in the termcolor submodule

cd termcolor
echo Hello>>hello.txt
git add .
git commit -m "Add hello.txt"

Finally, I want to push this commit to my remote repo, but I think git wants login and password for this submodule repo, which, of course, I don't know.

git push origin master
Username for 'https://github.com': lyalival
Password for 'https://[email protected]': 
remote: Invalid username or password.    

So, the question is, why git doesn't push it to my project repository?

P.S. For instance, in my main folder, I push the changes without writing login and password, I just typing

git push origin master

Upvotes: 1

Views: 627

Answers (1)

Valery Lyalin
Valery Lyalin

Reputation: 91

Finally I solved it. I thought that git adds local copy in my repository, but it doesn't.

So, in case I want change the submodule, I need create a new project and then

cd submodule
git remote set-url origin [link_to_my_project]

And then I was able to

git push origin master

Upvotes: 1

Related Questions