That's why the CLI is suggesting you (always Git will suggest things within parentheses) to use git add in the way it is being presented to you, you must track not only the. Any change made (within any submodule) that you want to confirm/use in the main repo, must be committed and pushed, not only within the submodule but, as by the above-mentioned, also in the main repo, like if the submodule (path) were a regular file of the main repo for your main repo, internally the path of every submodule is a file that includes the commit of that repo that must be used for your repo to work With that, the version of every submodule will and must be tracked too, the commit (hash) that your submodule is heading when you added it to your repo, will and must be tracked. Just bear in mind that the sole/main purpose of Git is to be a distributed control version system How can I remove this untracked status for submodules? I'm not sure if I need to remove some cached files or something but any help would be appreciated. They won't show up as untracked files when entering your commit message in your EDITOR. More details can be found on the gitignore man page. ![]() I thought the parent git directory wasn't supposed to track submodules and would ignore them. 6 Answers Sorted by: 98 If you don't ever want to commit them to your repo, use a. ' to update what will be committed) (use 'git restore. submodule 'zen-coding-gedit3' path zen-coding-gedit3 url git:///leafac/zen-coding-gedit3. To get rid of new / untracked files, you'll have to use git clean Usage Examples and Options Let's take a look at an example scenario: git status On branch master Changes not staged for commit: (use 'git add. By adding the ignore dirty option to each one of the entries in the. I've tried using git status -ignore-submodules and the submodule.ignore options in the. 12 Answers Sorted by: 172 I found this blog post to work overall. If I try to git add req_git_repos folder, I get the following warning: Check the list of untracked files and execute the git clean -f command to remove them from the current Git working tree. The issue is that after I do this, I still get the following prompt in my git status output: skillTest001/themes/zen Untracked files: (use 'git add .skillTest001/archetypes/animal/default.md deleted. routerpasswordv2/themes/hugo-theme-cleanwhite deleted. You can do git clean -df but that will also remove un-tracked directories. to discard changes in working directory) deleted. You have to use git clean -f -d to get rid of untracked files and directories in your working copy. I used git submodule add to clone the repos into a directory in my dotfiles git repo called "req_git_repos". 4 Answers Sorted by: 65 If you have it in ignore, use git clean -xf. This usage of the exclude file is recommended by the page "Ignoring files" on GitHub Help.I am new to using git submodules but wanted to start using them for managing my dotfiles, and the repos required for my dotfiles to set up properly. Note that this overwrites the existing exclude file and if the filename specified contains special characters that could affect the regular expression, the results are unpredictable. Or other commands could approximate it:Įx -s -c"g/^$\$/d" -cwq. The exclude file would need to be edited and the filename deleted from it. This also works for changed repo files, but there isn't a specific undo command for it. ![]() If the file is new and not added to the repoĪdd its filename to the repo's exclude file: The update-index command doesn't work with new files that haven't been added to the repo yet, though. ![]() Git update-index -no-assume-unchanged "$FILE" git status will not list the untracked files, so you need to be careful to remember if you create any new files and manually git add them. Git update-index -assume-unchanged "$FILE" The -untracked-filesno flag or the status.showUntrackedfilesfalse config (see above for both): indicate that git status should not report untracked files. In those cases, use one of these solutions: For example, locally-generated files that other users aren't likely to generate (e.g., files created by an editor) or files of experimental test code might not be appropriate to appear in a. I added to the /.bashrc a PS1 with changes to the bash prompt so it also shows git branches and status, but if im in not a folder with git and goes to one in the terminal, it wont run that PS1 ( because when I opened the terminal it wasnt on a git folder ). Changes not staged for commit - modified: Changes to be committed: Your branch is ahead of. gitignore might not be a good option, either. up-to-date AND working directory clean Untracked files. There are times notifications aren't wanted about either a changed repo file or a new file that needs to be added to the repo.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |