Alert Symbol On Texmate File and Folder - textmate

Hi I'm new on TextMate.
What does it mean with these symbol on folders and files in TextMate? Is it a problem? How do I solve it?
thank you,,,

They show you the current state of the files in your version control system (Git, subversion).
The symbols on your screenshot mean that those files are currently not tracked. There are various other symbols for deleted files, edited files and so on...
To "solve" it, you can select those files in the file browser, press ⌘Y for the Git menu and choose to commit them (assuming you have the Git bundle installed).
If you just want to disable the symbols, theres an answer for a tm_properties setting over here: How can I remove SCM file status from the project drawer in Textmate 2

Related

Using Xcode preferences vs .gitignore file

I'm new to git repositories and have found lots of great support for creating a .gitignore file that I would put in each project directory.
However, I've noticed that in Xcode 10 preferences under Source Control under the git tab there is a spot to specify files to ignore. Is there an advantage to defining the exclusions in Xcode versus the .gitignore file? I can't seem to find anyone that actually does it this way and Apple docs are light.
Are there some items (maybe globals) that I would put be better putting in prefs?
Thanks!
Are there some items (maybe globals) that I would put be better putting in prefs?
They should all be globals. There is probably no reason for you to have individual .gitignore files on a project by project basis. The Xcode 10 preferences to which you refer is merely another window onto your global .gitignore file. It is, after all, git that is to do the ignoring — not Xcode.
Your question seems to imply that you are not using a global .gitignore file. Use one. What I do is maintain this file in my home directory, and call it .gitglobalignores. The file is pointed to through the .gitconfig file (there's a good explanation of how to arrange that here). Whether you type out the file by hand in a text editor or manage it through the Xcode 10 preferences window doesn't matter.

Restore deleted files in visual studio code in the code management menu

I am really devastated because I have accidentally deleted 3 of my files in Visual Studio Code. I did it through the Source Code Management menu on the left side. Now my question... Is there any possibility to restore the 3 files I deleted like this? I would appreciate any answer and maybe you want to know: I use Windows
:-(
I tried to look into the recycle bin of windows but it isn't there. :-(
vscode maintains a file-history using its latest TIMELINE view.
How to restore deleted git-untracked files in vscode:
Create the files with the same name at the same directory.
Go to TIMELINE on the File Explorer.
You can get the older versions of the files.
No, you cannot recover those files using VS Code or standard tools. They aren't put in the recycling bin (or your operating system's equivalent), they are removed using git cleanor git reset --hard. Condolences :-(
There are of course utilities for recovering deleted files that may or may not be successful, but that is outside the scope of this question.
I accidentally removed a file that wasn't even checked in to git. Google brought me here. The file wasn't in the Trash can either (Ubuntu 18.4 VS Code 1.31.1). Looking at the git output I can see that it used git clean -f to remove it by force).
Fortunately the file was still in the editor. Just press Ctrl+P and type the file name. It should show up in the list of files and if you open it, it says "FILE_NAME (deleted from disk)" on the tab. Just copy/paste the content to where it should be.
if you accidently click the delete menu option right below rename, as long as you don't panic and like restart your computer or something you can open that directory in the file explorer on your computer
and right click.
there should be options there to undo delete or whatever else you did to the directory.
Open VSCode's command menu, and type "Local History" and select "Local History: Find Entry to Restore." Then type the name of the file you deleted.
This has worked for me when "undo" in the file tree has not.
Super easy, and has saved me from despair.

.xcodeproj file is lost, cannot be opened after a branch merge

I just merged one of the feature branches into develop branch, and since then, when I open Xcode, the .xcodeproj file seems lost, all files in the project navigator are gone also. click on the .xcodeproj file I get the following alert: The file couldn’t be opened.
This is although I am adding .xcodeproj to the .gitignore file across all the branches. Have you encounter such situation?
This might be caused by unresolved merge conflicts. In that case the XML structure is broken, so Xcode can't read it.
In that case you can try this:
In finder right click on the .xcodeproj and choose 'Show Package contents'.
Open project.pbxproj in an text editor (this is the actual project file, and has to be valid XML)
Check for merge conflicts (look for <<<<<<< and >>>>>>>) and manually resolve them (be careful!), and ensure the file has valid XML format
Save the file
Try again opening the .xcodeproj with Xcode
There might be better ways of resolving the conflicts, but this worked for me multiple times.
You also might want to check out this question: How to resolve merge conflicts in Git?
Basically, in a project if more than one developer are working and one developer has added some files(it may be .h,.m or any .png) and commits the project including .xcodeProj in source control management.
But due to some reason developer removes files or images from the project and also removes the use of those files or images from the project but forgets to commit the.xcodeProj project file.
If another developer checks out from the source control management and runs the application,he would get error messge error:path file/image name:No such file or directory.
So to avoid the error to run the application at our end successfully we can follow below steps
Right click on projectname.xcodeproj and click on showpackagecontent.
There we will get another file as project.pbxproj.
Open that file on text edit and remove the lines where the file or image has been mentioned.
Save the file.
And finally run the application it will work.
I know this is an old thread, but I had this issue today. I initially shrugged this answer as I don't have multiple users on the project, but I:
right clicked on the .xcodeproj and chose 'Show Package contents'.
From here, I noticed I couldn't open the project.pbxproj. I 'didn't have the necessary permissions', so I...
changed the permissions on the file to everyone can read/write, and then I was able to open the project without issue in Xcode.
not sure where this got crossed for me, but in case anyone sees this and has a similar issue and it's not a merging conflict.
Faced with the fact that the above methods did not work for me, my reason was this: when merging two files, the structure inside of project.pbxproj file overlapped and was broken, all I did was again thoroughly scan the conflicting sites for the correct syntax {some code} , availability ';' etc.

Duplicate and rename Xcode project & associated folders [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I would like to be able to duplicate an entire Xcode project, rename the project and the associated files without Xcode going mental, and without having to manually re-import all files to the project.
This answer is the culmination of various other StackOverflow posts and tutorials around the internet brought into one place for my future reference, and to help anyone else who may be facing the same issue. All credit is given for other answers at the end.
Duplicating an Xcode Project
In the Finder, duplicate the project folder to the desired location of your new project. Do not rename the .xcodeproj file name or any associated folders at this stage.
In Xcode, rename the project. Select your project from the navigator pane (left pane). In the Utilities pane (right pane) rename your project, Accept the changes Xcode proposes.
In Xcode, rename the schemes in "Manage Schemes", also rename any targets you may have.
If you're not using the default Bundle Identifier which contains the current PRODUCT_NAME at the end (so will update automatically), then change your Bundle Identifier to the new one you will be using for your duplicated project.
Renaming the source folder
So after following the above steps you should have a duplicated and renamed Xcode project that should build and compile successfully, however your source code folder will still be named as it was in the original project. This doesn't cause any compiler issues, but it's not the clearest file structure for people to navigate in SCM, etc. To rename this folder without breaking all your file links, follow these steps:
In the Finder, rename the source folder. This will break your project, because Xcode won't automatically detect the changes. All of your Xcode file listings will lose their links with the actual files, so will all turn red. Note: You may have to do Step 2 first, then come back to this step.
In Xcode, click on the virtual folder which you renamed (this will likely be right at the top, just under your actual .xcodeproject) Rename this to match the name in the Finder, this won't fix anything and strictly isn't a required step but it's nice to have the file names matching.
In Xcode, Select the folder you just renamed in the navigation pane. Then in the Utilities pane (far right) click the icon that looks like dark grey folder, just underneath the 'Location' drop down menu. From here, navigate to your renamed folder in the finder and click 'Choose'. This will automagically re-associate all your files, and they should no longer appear red within the Xcode navigation pane.
In your project / targets build settings, search for the old folder name and manually rename any occurrences you find. Normally there is one for the prefix.pch and one for the Info.plist, but there may be more.
If you are using any third party libraries (Testflight/Hockeyapp/etc) you will also need to search for 'Library Search Paths' and rename any occurrences of the old file name here too.
Repeat this process for any unit test source code folders your project may contain, the process is identical.
This should allow you to duplicate & rename an Xcode project and all associated files without having to manually edit any Xcode files, and risk messing things up.
Credits
Many thanks is given to Nick Lockwood, and Pauly Glott for providing the separate answers to this problem.
Duplicating an Xcode 4 Project
Renaming xcode 4 project and the actual folder
I'm posting this since I have always been struggling when renaming a project in XCode.
Renaming the project is good and simple but this doesn't rename the source folder. Here is a step by step of what I have done that worked great in Xcode 4 and 5 thanks to the links below.
REF links:
Rename Project.
Rename Source Folder and other files.
1- Backup your project.
If you are using git, commit any changes, make a copy of the entire project folder and backup in time machine before making any changes (this step is not required but I highly recommended).
2- Open your project.
3- Slow double click or hit enter on the Project name (blue top icon) and rename it to whatever you like.
NOTE: After you rename the project and press ‘enter’ it will suggest to automatically change all project-name-related entries and
will allow you to de-select some of them if you want. Select all of
them and click ok.
4- Rename the Scheme
a) Click the menu right next to the stop button and select Manage Schemes.
b) Single-slow-click or hit enter on the old name scheme and rename it to whatever you like.
c) Click ok.
5 - Build and run to make sure it works.
NOTES: At this point all of the important project files should be renamed except the comments in the classes created when the project
was created nor the source folder. Next we will rename the folder in
the file system.
6- Close the project.
7- Rename the main and the source folder.
8- Right click the project bundle .xcodeproj file and select “Show Package Contents” from the context menu. Open the .pbxproj file with any text editor.
9- Search and replace any occurrence of the original folder name with the new folder name.
10- Save the file.
11- Open XCode project, test it.
12- Done.
EDIT 10/11/19:
There is a tool to rename projects in Xcode I haven't tried it enough to comment on it.
https://github.com/appculture/xcode-project-renamer
As of XCode 7 this has become much easier.
Apple has documented the process on their site:
https://developer.apple.com/library/ios/recipes/xcode_help-project_editor/RenamingaProject/RenamingaProject.html
Update: XCode 8 link:
http://help.apple.com/xcode/mac/8.0/#/dev3db3afe4f
I am using this script after I rename my iOS Project. It helps to change the directories name and make the names in sync.
http://github.com/ytbryan/rename
NOTE: you will need to manually change the scheme's name.
I'm using simple BASH script for renaming.
Usage: ./rename.sh oldName newName
#!/bin/sh
OLDNAME=$1
NEWNAME=$2
export LC_CTYPE=C
export LANG=C
find . -type f ! -path ".*/.*" -exec sed -i '' -e "s/${OLDNAME}/${NEWNAME}/g" {} +
mv "${OLDNAME}.xcodeproj" "${NEWNAME}.xcodeproj"
mv "${OLDNAME}" "${NEWNAME}"
Notes:
This script will ignore all files like .git and .DS_Store
Will not work if old name/new name contains spaces
May not work if you use pods (not tested)
Scheme name will not be changed (anyway project runs and compiles normally)
In the example code for the book "Instant OpenCV for iOS" I have found a bash script that copies a project from a folder to another.
Doing a little research I've found a blog post from what seems to be the original author of the script: http://mohrt.blogspot.it/2009/01/renaming-xcode-project-from-command.html, where you can download the script. I gave it a try and running it from terminal like this
sh renameXcodeProject.sh <name-of-existing-folder> <name-of-folder-to-create>
works fine.
Additional info can be found opening the file with a text editor. Hope that helps
I using Xcode 6+ and I just do:
Copy all files in project folders to new Folders (with new name).
Open *.xcodeproj or *.xcworkspace
Change name of Project.
Click on schema and delete current chema and add new one.
Here is done, but name of window Xcode and *.xcodeproj or *.xcworkspace still <old-name>. Then I do:
pop install
Open <new name>.xcworkspace
One more thing to try!
When I copied all of my files, opened the project, and renamed it, everything changed to my new project name except for the test target! I got a linker error that said I was missing a file called "myOldProjectname.app". Here's what fixed it:
Click on your project settings and select your test target
Click on build settings and search for "test host"
Check those 2 file paths. Chances are that those 2 paths are still pointing at your old project name.
Hope that helps!
For anybody else having issues with storyboard crashes after copying your project, head over to Main.storyboard under Identity Inspector.
Next, check that your current module is the correct renamed module and not the old one.

How to stop Xcode from thinking files are missing

I deleted some files from my project (a pair of .m/.h).
However now every time I build Xcode warns that the files are missing (though the build is otherwise successful).
I can't see where/how Xcode thinks the files are needed, it must have some reference to them somewhere but I can't find it - the files are not listed in either the compile sources section nor the copy bundle resources section. Where else might they be listed such that Xcode feels the need to warn about them not being physically present?
To delete them try this:
create a file named like the missing one
copy this file into your project folder, so that Xcode recognizes it
right click on the file inside Xcode in the project view
select delete
select move to trash, when Xcode asks
This worked for me for files, however I have the same problem with empty folders. If somebody knows a way to get rid of the missing warning for them, please comment.
If the files are missing from the project navigator or your checkout, but not included in the build for the current target, then the build might succeed despite the warnings.
XCode's Project Navigator keeps track of files, the directory they're in, and the state in git or svn. The project warnings when opening a project are shown in the status view at the top of the window. You can review these warnings when you press command-4.
The project navigator marks files that it tracks, but that it cannot find, in red in the folder view (press command-1 for that view). If you see red file names it might be that you deleted or moved them into another folder without XCode knowing about that. Then select the red filename and delete it.
On top of this the files might be "missing from your work copy", but still present in the repository. You can do two things in the terminal to sync with or delete the file from subversion.
svn up file
svn rm --force file

Resources