2

I changed code in submodule and want to share with other team members.
(Wow git submodule is hard)

> cd to submodule
> git add/commit
> git push prompts me Username: and Password:
> Username: 
> Password: 
> error: The requested URL returned error: 403 while accessing 
> https://github.com/hovel/pybbm.git/info/refs

I read I have to push the change before other people can do git submodule update to see the change.
I thought I'm pushing it to some local repo? why is the error showing me github(original repo) and how do I fix it?

eugene
  • 39,839
  • 68
  • 255
  • 489

3 Answers3

1

I have to push the change before other people can do git submodule update to see the change

You have to:

  • push the changes made in the submodule
  • and go back one level in the parent repo, commit, and push

When others are doing git submodule update, they are doing it from a clone of the same parent repo, which contains the references (address and SHA1) of each submodule.
If you haven't push those special entries recorded by the parent repo, no update will be possible even if you have push the modif from your submodule.

A submodule is a clone of a git repo: you cloned it from https://github.com/hovel/pybbm.git, which is an address you don't have the right to push back (submodule or not).
You need to fork that repo first, and use that fork as your submodule url.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Check your git version. Github will show an error using https if you don't use git 1.7.10 or later as you can see in https://help.github.com/articles/https-cloning-errors .

William Seiti Mizuta
  • 7,669
  • 3
  • 31
  • 23
  • mine is 1.7.2.5 and apt-get install git/git-core says it's newest version – eugene Jan 10 '13 at 03:48
  • you can download the git source code and compile it or use ssh protocol instead of https protocol. For the last, you need to change the url in .git/config file to the url that represents the git protocol in github. – William Seiti Mizuta Jan 10 '13 at 05:10
0

Is that submodule your own? You might get 403 error when you are trying to push to someone else's repository. If you want to update the submodule that is based on someone's work, you should instead make a fork of that project, then use that fork as submodule.

aragaer
  • 17,238
  • 6
  • 47
  • 49