JzQgPosDVk/Mmr3MDyWgrgRwnoEKgyKijOkm3fo5T4MQyrtVh0lNQIggJS9dQzzZ+Hw=ĪK7set9YigkXZWn+Ylv2PtMSHn6MPdQscJKwMMVWIm0JimNVKRs0J9pxiFf2SW+A/lkxu0baJ+pLcP3cL5YjYjg= OSj7BJW5fVZ25coha37TKMiwCKa8sQ/lfgAdASaycR9yrHk1elbCVH5ngdnmn1uSOQeRQWKj2ii X-Gm-Message-State: AO0yUKUbGpNXhpltcuKqdcImUHXuKmbp0YZHND8dwdEBF0PhcaZACGX1 LEisHnNXx8CNSwnqHSUFX18+pNFQk+N1z80+MKwNMt9pr3Naynj1ABkIiT0MiG/xv9/n YkuDcwAawB2dEm0Yy7xj/Yx0JhLfKrTkl9xqIuUftR2+6GjQnAPFhl6gv/EViBe/b2pI Q6a6Kg1n/Bu5kmARj7jRNHhILPNQoaW0KriJe6WBCM1V+uJgO5uYGBlyjLrJCINsJWsG :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to ī=lOFqflep+0dZ5ALc8zwgrp5iqJyMweFU+RTMVnr1xTIUKRIxr4kNPcyMfD4TlDX3tLī6p1WRzjzGDDnjFU8Ym1TfDr7XGtF66yvhoKr1x2qju14NbjjruJQjOzcik81iQHk91j X-Google-DKIM-Signature: v=1 a=rsa-sha256 c=relaxed/relaxed TzO+VTraYpJGlwYmIz5GNzCaBke0P9LmONRRKGh491PAKaIhV4iVRE+2D7KkY/WMs9aB XIuBuu6no/qWN/XMvW圓58+tPvbViuuxSoJwRCTX61qZz6jl+UbsCIn4Vo/aqg9Rmw09 N2lJ/SIGfCKKIp0pugxnHRh/Ow539b12VQsMpMK8G3ihWui8NinUDZPhoCugR3WRSbn3ĦIfyyRspb/rJ4xlE8XJWupGJuR6rPCIn/hkT0dGikSizpEXpi8dCCFHwKXL/dkVCQh2V :date:from:to:cc:subject:date:message-id:reply-to īh=szMBxcd2fJhk+Yu9QkKAojMWq8dbuky/TvC4i1sj5us= ī=fVuvPq6qv38Eb0m4645bFUPcXdNu49UFrJBeIUqaByW03TbQPSfGtcstYTyfTf0CKy H=cc:to:from:subject:message-id:references:mime-version:in-reply-to Received: from (īy (Postfix) with ESMTPS id B991D30193 Received: from ( )īy (Postfix) with ESMTP id A1343C64ED6 If you want to see what this looks like once pushed to remote (github.X-Spam-Checker-Version: SpamAssassin 3.4.0 () onĪ Git commit -amend -no-edit # I combined this with the previous commit where I added the 'branch' value in. So finally, I did what I was trying to avoid: git add You have to go and update that submodule commit reference to the latest code in the remote branch to avoid this So far, I was following the official git reference for submodules, now I decided to do some more Googling, and I stumbled an article titled Getting git submodule to track a branch, this clearly said Post this, when I ran git submodule update -remote -init -recursive, it would no longer revert my submodule's HEAD in detached state to commit A however it still kept showing the annoying modified: (new commits) So then I set the branch value as new-submodule-branch in /.gitmodules as follows If, from the main repo root, I ran git submodule update -remote -init -recursive, it kept reverting my submodule's HEAD in detached state to commit A " to discard changes in working directory) Post this, my main repo started showing Changes not staged for commit: Initially my submodule was at commit A (at the time of adding submodule to main repo), then I checked out a branch (let us call it new-submodule-branch) and made commits B and C to it and pushed it to remote () I am documenting/sharing here what worked for me. None of the answers here solve my problem. To update which commit records should be checked out for the submodule, you need to git commit the submodule in addition to committing the changes in the submodule: git add src/repo No changes added to commit (use "git add" and/or "git commit -a") (commit or discard the untracked or modified content in submodules) git status also claims submodule has untracked/modified content. Otherwise it shows -dirty hash change which you cannot stage or commit in the top-level repository. If you've already made some commits in your submodule (thus "clean" in submodule), it reports submodule's hash change. Run git diff in the top-level repository to show what has actually changed Git thinks. If you change something in submodule dir, Git will detect it and urge you to commit those changes in the top-level repoisitory. It's because Git records which commit (not a branch or a tag, exactly one commit represented in SHA-1 hash) should be checked out for each submodule.
0 Comments
Leave a Reply. |