logo
down
shadow

Does git submodule branch switch along with main project's branch?


Does git submodule branch switch along with main project's branch?

By : Hugo Hart'Beat
Date : November 28 2020, 11:01 PM
With these it helps I recently came across a similar question. (I'll let you read the content of this answer as it gives you the background to my answer).
A submodule is just a reference to a repo and a commit in this repo.
code :
$ git submodule update 


Share : facebook icon twitter icon
Why does switch of branch update submodule (without explicit pull)?

Why does switch of branch update submodule (without explicit pull)?


By : Sven Schill
Date : March 29 2020, 07:55 AM
like below fixes the issue It's not quite right to say that the switch updated the submodule. The submodule was updated when you ran git submodule update. Submodules are a bit weird. As this page says:
git: checkout files from another branch into current branch (don't switch HEAD to the other branch)

git: checkout files from another branch into current branch (don't switch HEAD to the other branch)


By : 4SL
Date : March 29 2020, 07:55 AM
I hope this helps . checkout by providing the current path, .:
git checkout other-branch-name -- .
Git: how to ignore new submodule of a branch after switch to another branch?

Git: how to ignore new submodule of a branch after switch to another branch?


By : Sagar Chour
Date : March 29 2020, 07:55 AM
will help you Well, as it is not required by master and hotfix, you can easily delete it.
It won't affect your feature-new-theme branch (if you submodule init/update after checking out back to it), it will clean up your current repo state.
code :
git clean -f -f -d
perforce re-branch (reset dev branch to current status of main branch)

perforce re-branch (reset dev branch to current status of main branch)


By : mdzwonek
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I have a dev branch with many changes (files added, deleted...). The dev branch is very different from the main branch. I want to make my dev branch be exactly the same as the main branch in current state (as if I just created it). Integrate do not fully match the branches. added files in the dev branch are not being deleted. What is the best way to do it? Delete the dev branch and re-create it? in advance ,
Delete the dev branch and re-create it?
code :
p4 obliterate -y //depot/dev/...
p4 populate //depot/main/... //depot/dev/...
How to switch git submodule with other branch properly?

How to switch git submodule with other branch properly?


By : user3207421
Date : March 29 2020, 07:55 AM
Does that help You can edit .gitmodules manually (using an editor) or using git config -f .gitmodules. After modifying sync it to .git/config with the command git submodule sync and update submodules using git submodule update --init --remote.
Related Posts Related Posts :
  • How to review a pull request in intelliJ IDEA?
  • How can I see what git commits will be pushed for a NEW git branch?
  • Git push master branch to secondary remote
  • Understanding Git conflict cause
  • How to merge parts of old commit with HEAD in git?
  • Git submodule commit
  • Where to create GIT tag on master or branches and merging activity
  • Git reflog a specific branch?
  • Deploying a unique application version to specific user
  • How to edit files in an old tag without deleting current changes
  • How to remove a "branch" in repository after a git rebase on my local machine
  • Is `git rebase master` always followed by `git pull --rebase` and then `git push --force`?
  • Error: src refspec does not match any
  • Git - different commits each, respectively. (use "git pull" to merge the remote branch into yours)
  • How to checkout remote branch git?
  • How to rebase git submodule preserving references to submodule commits from git repository containing the submodule?
  • Git checkout ... doesn't checkout files
  • List and cat files at certain commit
  • Permission denied (publickey) on pod setup
  • Github API languages endpoint
  • Can't commit to cloned repository
  • How to use `git describe` on repos without tags?
  • Git completing cherry pick
  • How can I find added lines (not changed) using git diff?
  • Git script to rebase and squash temporary commits
  • Can git checkout to remote branch without pulling files?
  • Accessing local git progress from another machine without committing
  • Trying to use a git repo on a share drive but cannot access files with apache or windows explorer
  • how to list all pull request with count of files changed
  • Why is this a bad config line for my .gitconfig?
  • Ignoring target dir in sub projects
  • Git: squashing material shared between branches
  • git: global configs not getting used in repositories
  • Git list of changed files has been wiped
  • Git no such file or directory
  • Specify commit template for a remote git repository
  • How to get `git diff master` as unstaged edits in the branch I'm in?
  • Gitkraken Desktop App - Error login: "Please log in to continue"
  • Check response of git push from shell script
  • How should you create a patch for an older tag in source control?
  • .gitignore doesn't ignore files in subdirectories
  • SSH Advice, git cloning from multiple Jumps
  • How can I change the remote (hosted) repo to which my workstation (local) repo pushes information?
  • code not merge and commit through source tree
  • Babun's git and Windows' git don't work together
  • Git command to programatically add a range of lines of a file to the index?
  • Use ANT to update a YML file with exec output
  • How to find, who has been delete commits from bitbucket?
  • Git - chain rebasing issue
  • How can I prevent a file (.json) to be commited with a git hook?
  • git: How to get copies of conflicting files?
  • How do I start retracking a git repository?
  • Git hook to produce Github "Create Pull Request" link in terminal like Bitbucket Does
  • git custom commit id?
  • Cloning git branch in pycharm
  • GitHub error - "ssh_exchange_identification: read: Connection reset by peer"
  • git reset resulting in changes to both working directory and stage
  • How should I use .gitignore?
  • Git: Is there a way to push a commit only held by a tag, without pushing the tag?
  • Since Windows now got Linux Subsystem is it possible to replace git bash/cygwin?
  • shadow
    Privacy Policy - Terms - Contact Us © soohba.com