For some reason PhpStorm won't apply right colours to new, updated, deleted etc. files, neither in the navigation list nor in the tabs. I'm using GIT, PhpStorm 8.0.3 and OSX. As you can see below, all the file names are in white colour although the most of them are new and modified.
I already went through Where to change color for file names in tab row of PhpStorm, Phpstorm Git file colors, File Colors and File Status Highlights so does anyone know what else I should do to activate file name colouring?
EDITOR with new, edited, deleted files.
File before edit
File after edit
VCS 1
VCS 2
GIT status
inanzzz-MBP:sport inanzzz$ git status
On branch form-type-crud
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: src/Football/FrontendBundle/Resources/views/Default/index.html.twig
no changes added to commit (use "git add" and/or "git commit -a")
Your VCS1 screenshot indicates that Git integration is not correctly set for the project. Use the + button on the VCS integration window to tell PhpStorm where the root is.
It should look like this:
Related
In Mercurial (preferably via TortoiseHG interface) is it possible to copy a committed file, and for the new destination file to share the history for the source file?
I'm pretty sure this is not possible, but I'm asking in the hope that it's just really well hidden in the documentation.
I have a file with a fairly long history of changes, but I now need to have have a 2nd copy of this file within the project which will contain it's own individual changes. However, it would be exceedingly useful to be able to view the history of this copied file and see all the changes that took place on the original before the copy took place (as well as those that have taken place since the copy).
Update
Thanks to #Inspired for their answer. As I said in my comment to them, I was at fault...
I just realised why it wasn't working: I didn't copy the file through either the command line or THG, but through Visual Studio (2010) using VisualHG. VHG must copy the file and then add it, rather than using the mercurial copy function. So I need to remember to use mercurial directly in the future!
Or to be more precise, my guess is that VisualHG cannot override the default functionality of Visual Studio, and therefore can only work with the copied file, rather than run the mercurial copy command. This is purely my guess.
From command line, you can issue hg copy <old name> <new name>. Mercurial does save the history log when you perform copy or rename (hg cp / hg mv).
In TortoiseHG the copy is a bit tricky: you have to copy the file manually (e.g. via cp), then in THG in Commit mode right-click at the left low pane with the unversioned new file and select Detect renames. Uncheck Only consider deleted files, let TortoiseHG find similar files and click the source file when it finishes. TortoiseHG will record the new file as a copy.
I haven't found a simpler way.
When viewing history from command line, you need to specify -f (or --follow) when you are viewing the history: hg log -f <filename>. TortoiseHG already does that.
When trying to export a patch for a commit, the resulting patch file doesn't include empty files that were added in the commit.
Steps to reproduce:
Create a new folder and initialize it as an Hg repository.
Add some zero-byte file to that folder, and create an initial commit for that file.
Create a second zero-byte file, and create a second commit for that file.
In Hg Workbench, right-click on either of those commits, and choose Export >> Export Patch.
Open the resultant patch file in Notepad / any text viewer.
Observe that the patch file does not contain any information about the new files that were added.
It seems like the newly added files should be included. If I exported that patch and someone else applied it, they wouldn't really be getting the full changeset, since the new files aren't included.
Can someone tell me what I'm doing wrong, or why it behaves this way? This is not the behavior I expected.
I'm using TortoiseHg 2.7.1, which includes Mercurial 2.5.2.
I version controlled a project settings folder a couple months back on my default branch, and then over time created many branches off default. Now I've decided that I'd rather not have the project settings folder version controlled as it creates a lot of problems when switching between branches.
So I've hg forget'd this project settings folder which lets me keep the files on my local machine but removes them mercurial. However, when switching from one of the old branches which still have this folder versioned back to the default branch it actually removes the files from the local machine, which is bad.
How do I prevent that?
The folder is also in .hgignore on default now.
It's impossible to do.
But the common practice is to keep config.ini.dist in your repository and build environment-specific config by some build-system right after you check source code out.
The standard way to deal with this is to version control a template config file and ignore the real config file. The real config file can then include the template file, or maybe the template file is copied over once in a while.
The underlying reason for your problems is that running:
$ hg forget config.ini
is exactly the same as running:
$ hg remove config.ini
$ hg cat config.ini > config.ini
The forget command leaves the file behind in your working directory, but what you commit is still a file removal. This means that afterwards, Mercurial cannot distinguish between "file was forgotten" and "file was removed" — only the removal is committed, so the two commands look exactly the same.
So I accidentally included a config file (different for each machine) into our mercurial repositories.
How can I get Mercurial to not include it in version control? I don't want to delete the file since I still want it. And I don't want to cause the file to get deleted on other developer's working directories either.
And how do I do this in TortoiseHG?
Right click on the file -> TortoiseHG -> Forget Files. Click Forget. Commit and Sync.
Edit:
You'll also want to add the path to your .hgignore to keep it from getting added again. You can right click on the file in the HG Commit dialog and choose to ignore it.
Here's the manual way of doing it through the command line:
Copy the config file somewhere outside of the repository.
Run hg rm path/to/config/file
Add the config file path to your .hgignore.
Commit the repository.
Move the config file back to where you had it.
Do an hg stat on your repository to double check you did everything right. (It shouldn't show up in the list of modified/added files).
Edit:
hg forget is the best way to do this.
Run hg forget path/to/config/file
Edit your .hgignore and add the path to the config file.
hg ci to save your changes.
Run hg stat to ensure everything worked according to plan.
See nates answer for how to do it TortoiseHG.
hg remove or hg remove -f?
I think hg forget also removes it from the branch.
In both cases, files are retained in your directory.
For those using SourceTree, there is an option Stop Tracking when you right click a file, it basically does the same thing as hg forget or git rm --cache, removing the file from repo but not from hard disk.
add it to your ignore list.
See the .hgignore file.
TortoiseHG gives you access to this config file via the "Edit Ignore Filter" menu option.
Am having problems removing a file from Tortoise.
I make the clone, and there are a few test files which I want out. What is the proceedure for removing a file from the repository,
thanks in advance,
Right-click on the file(s) and click the TortoiseHg --> Remove Files... and then confirm the dialog. Commit to save the change to your local repository. Note that this will delete the file from disk and from Mercurial.
If you'd like to remove a file from Mercurial but keep the file on disk, you can click TortoiseHg --> Forget Files.... Then you may want to add the file to your .hgignore list (you can do this graphically through the Commit or View File Status dialogs) so that you don't add it accidentally in the future. Then commit.