I am seeing this icon on my atom text editor for the first time. Can anyone tell me what it means? I am referring to the dist folder.
This icon is used for a Git submodule, which means that the folder is a separate Git clone (fixed to a certain commit) of a different repo.
Check whether you have a file called .gitmodules in your project's root folder, it should show you which repo that folder points to.
That would also explain why that folder was not pushed to Git. Git is simply keeping track of which repo and commit this folder points to. When cloning this repo on another server, you'll have to make sure that the submodule is checked out as well.
Please take a look at the documentation for Git submodules that I linked to in the first paragraph.
Still not sure what it does, but that folder was not pushed to git correctly when deployed. Something about it being ignored although it was not on my .gitignore.
Related
Previously, I had WordPress' wp-config.php committed; since then, I've now ignored this file in .gitignore, which is fine.
Unfortunately - now when pulling to live, it provides this error:
M .htaccess
U wp-config.php
Pull is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm <file>'
as appropriate to mark resolution, or use 'git commit -a'.
Before this issue happened, I had an issue with pulling where it said I had uncommitted changes with these files - so I let it overwrite them, then I uploaded the actual files manually via FTP, which caused this new error.
I want to keep the files in their current state on the live server, but get around this error now and in the future.
What is the process of being able to pull the latest changes with this?
UPDATE - I'm adding an answer to a question posed in comments, and clarifying a related point
First let's clear up a little confusion: This error has nothing to do with putting the file in .gitignore. In fact, since the file is present in the index, .gitignore has no effect whatsoever on the file.
Before this issue happened, I had an issue with pulling where it said I had uncommitted changes with these files - so I let it overwrite them
You may need to be more clear about what commands you issued and what output you saw, because this is where your trouble is coming from.
When you say you "let it overwrite them", what does that mean? git resists overwriting local changes (especially uncommitted changes)...
I'm guessing what really happened is that git tried to merge changes from the remote repo into your local changes for those files, but had merge conflicts on wp-config.php.
And most likely it's still in a merging state, which you'll have to resolve before you can move on. If you say git status it will likely tell you that you're merging, with some changes "to be committed" (likely including the .htaccess file) and some "unmerged paths" (likely including the .php file).
If you have the .php file looking the way you want it in the work tree, then you can say git add wp-config.php and then git commit which should cause the merge to complete. (More generally, you have to get the file looking how you want it in the index, and do this in a way that tells git the conflict is resolved; and then you can commit to get out of the merging state.)
Now in comments you ask about whether this will put the file "back" into git. And that comes down to what it means to "have the .php file looking the way you want it".
If you never want git to provide the .php file (even during a fresh clone), then you need to remove it from the index and subsequent commit.
You could (at least temporarily) remove the file from the working tree and then do a git add (as noted above). Or, if you don't want to affect your working tree version, you can
git rm --cached wp-config.php
directly making the index look "how you want it". At this point it becomes possible for your .gitignore entry to help you avoid accidentally reintroducing the file.
If what you mean is that the file should be there, but only a default version should be in the repo (not taking any changes that might be made in the working tree), git won't do that. You'll have to get where you're going a different way. For example you could put the file in the repo as wp-config.php.default and ignore the wp-config.php path. After cloning the repo you would then copy the default file, and any local changes would be made only to the ignored copy.
I have a repository for a Wordpress intall that currently has all the Wordpress files included.
I have updated my .gitignore to only include the theme folder but when I push to my staging server it deletes all the files.
I need to keep all the files both locally and on the server, but I want them to stop being tracked and removed from the repository, Ideally with the history still intact.
Thanks in Advance
The server has a copy of the repository, so if you remove anything from the repository it will be removed from the server's repository as well (after you push).
However, you can set git to assume the files are unchanged. This will keep them in the repository, but git will stop detecting new changes to them.
I have a staging server I'd like to set up to git pull whenever updates are made to a BitBucket repo. It would be a single repo with multiple submodules, but I can break it apart if that's better.
It'd be a theme that goes to wp-content/themes/
And single/multiple plugins that go to wpp-content/plugins
My question is, (1) is this good practice? and (2) how can I pull the changes without introducing the .git metadata to those (or any public) directory? I assume the metadata has to be somewhere, but how can I hide it?
If this is too vague, please feel free to ask for clarification on something.
Thanks!
Just put the whole thing under git ?
Use .htaccess to disallow the .git folder.
You can use multiple repositories but updating means going to each one and git pull / git fetch git merge.
you could also move the .git directory outside of the web root, make a file called .git with the contents
`gitdir: /path/to/.git`
I use Git and GitHub to push changes I make on my local web development environment to my GitHub account and from there I pull these updates to my live production site. I am working with WordPress, so what I have done is .gitignore the wp-config.php file as my productions site has its own unique wp-config.php file with its own respective database credentials. As I am git ignoring this file, when I pull to my production site it gives me the following error:
error: Your local changes to the following files would be overwritten by merge:
wp-config.php
Please, commit your changes or stash them before you can merge.
Aborting
How do I prevent this wp-config.php file from being overwritten (more specifically deleted) when I do a git pull?
This is your machine specific config file. For such case its better to use build tool. For you its better to create your custom configuration on a special file my-config.php and include it in wp-config.php. Also ignore my-config.php in .gitignore. Now you'll never see any problem like this.
What you will see is my-config.php file not found error. And write it about in your README.
I do this whole thing with configure, make even the project is in php
If this was not a config file, and you are sure about the changes you can commit first and then execute pull. Other option is stash which is already told in the error message.
Your changes won't be overwritten. That's what the error message is telling you. The pull failed because git doesn't want to overwrite your changes.
To allow the pull to take place and keep your changes, do git stash before pulling. This will save a copy of your changes and allow you to pull without any issue. Then git stash pop after pulling will restore your changes. Note that you may experience a merge conflict if the changes you are pulling to wp-config.php touch the same part of the file as your local changes.
The other side doesn't have the ignore file in effect yet. Once it's there, you won't have this message. Also it's still tracked. So in addition to changing the .ignore file on both sides, you also need to delete it on both sides and from then on it will not get in the way.
Also take a look at octopress if you are going to be using git as part of your blogging routine.
I'm using WAMP to develop a small PHP application. I'm also using Cygwin + Oh-My-Zsh to manage my git repository that contains the .html and .php files for the application. My source files exist in a directory outside of the www directory, so I created a hard link via ln to the source files. This appears to work at first, but any changes I make in my working directory are not reflected in the linked files. How do I fix this? I haven't been able to find any information about this particular problem, so any help would be greatly appreciated.