Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to update a submodule version to latest ? #80

Closed
wants to merge 1 commit into from
Closed

How to update a submodule version to latest ? #80

wants to merge 1 commit into from

Conversation

manobi
Copy link

@manobi manobi commented Feb 15, 2012

I always have to do this, there are a better way ?

@paularmstrong
Copy link

You should actually just update with normal git methods like it's a standalone repo and then add the repo and commit:

cd submodule_name
git checkout master && git pull
cd ..
git add submodule_name
git commit -m "updating submodule to latest"

@tj
Copy link
Owner

tj commented Feb 16, 2012

yeah I just git pull as well. we could probably do with something like this but I dont get the name at all, readd? what is that?

@manobi
Copy link
Author

manobi commented Feb 16, 2012

readd === re add || remove && add

Good thing to automate, but I don't know a better name for it.
Suggestions ?

@tj
Copy link
Owner

tj commented Feb 16, 2012

oh I see. but yeah we should change how it's done anyway, typically like @paularmstrong mentioned you just cd in git pull origin master and cd ..

@paularmstrong
Copy link

update-submodules would be a more obvious, albeit verbose, command.

There's also a git submodule foreach method that you should consider wrapping this in so that all of a project submodules get updated.

@manobi
Copy link
Author

manobi commented Feb 19, 2012

update-submodule is easy to confuse with traditional git submodule update. Another suggestion ?

@gaving
Copy link

gaving commented Jan 16, 2013

+1 nice idea.

Currently doing the usual:- git submodule foreach git pull origin master

@kshcherban
Copy link

The other way to update submodule which tracks branch is:

git pull --recurse-submodules
git submodule update --remote --recursive

@hemanth
Copy link
Collaborator

hemanth commented Feb 4, 2015

Sorry for missing this!

@manobi Still interested to complete this?

If not any of you guys want to paw at it?

@FelikZ
Copy link

FelikZ commented Jun 10, 2015

@kshcherban the best way, thanks! I also like to use --merge instead of --recursive, it persist current branch in submodule.

@hemanth
Copy link
Collaborator

hemanth commented Jun 10, 2015

@spacewander Looks like we must bring in this?

@spacewander
Copy link
Collaborator

So, what name should we use for it?

update-submodule or merge-submodule or others?

@FelikZ
Copy link

FelikZ commented Jun 11, 2015

pull-submodule?

@hemanth
Copy link
Collaborator

hemanth commented Jun 11, 2015

merge-submodule sound good if fetch and merge we could name it pull-submodule?

@spacewander
Copy link
Collaborator

Ok, so name it as pull-submodule. I will try to dive into it this weekend.

@hemanth
Copy link
Collaborator

hemanth commented Jun 11, 2015

👍

@kornvigo
Copy link

pull-submodule?

@RobLoach
Copy link

The following command will update all submodules to the latest branch that's defined in .gitmodules...

git submodule update --recursive --remote
[submodule "my/module"]
	path = my/module
	branch = master

@MarceloMelo1
Copy link

git submodule foreach git pull origin master

shwanton added a commit to shwanton/dotbot-plugins that referenced this pull request Apr 18, 2020
@DreamAndDead
Copy link

git submodule update --remote

@tj tj deleted the branch tj:master October 21, 2023 08:47
@tj tj closed this Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet