My project should use the 'latest' for the submodule. On Mac OSX I merely did a regular. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Update a submodule to the latest commit Ask Question. Asked 10 years, 1 month ago. Active 8 months ago. Viewed k times. I have a project A which is a library and it is used in a project B. Marcel Gosselin 4, 2 2 gold badges 27 27 silver badges 51 51 bronze badges.
First do: git submodule update --remote --merge to make sure the submodules point to the most recent hash valid after git 1. Add a comment. Active Oldest Votes.
Changed but not updated: use "git add It'll be convenient in most cases. Kjuly Kjuly BTW, if you are not the owner of the submodule, you can just do git submodule update when someone else updated the projA you'll get a new commit id. Kjuly After the commit, how does one push it to the remote? Is it just git push? To update proj B to reference the HEAD of the remote tracking branch for proj A, you'll want to do git submodule update --remote --merge as shown in Paul Hatcher's answer below.
To update your repository to reference the new state instead, you have to commit the changes:. There might be some changes you have that can have merge conflict if you use git pull so you can use git pull --rebase to rewind your changes to top, most of the time it decreases the chances of conflict. Also it pulls all the branches to local. Git Submodules Updating a Submodule. Example A submodule references a specific commit in another repository.
Time passes, submodule upstream is updated. Change to the submodule directory. Checkout desired branch. Get back to your project root. Login Sign Up. Courses Ask a Question. Git Update submodule to latest commit on origin. Please log in or register to add a comment.
Please log in or register to answer this question. Related questions. How to change the remote repository for a git submodule?
Git submodule head 'reference is not a tree' error.
0コメント