Is there a way to detach a project from CVS in Xcode? - xcode

XCode's CVS support is abysmally bad. Or maybe it's just the server in my organization. Either way, it's leading to more headaches than it's worth so I'd like to "detatch" the project as I can in Eclipse. Is there an easy way to do this or do I have to manually delete all of the CVS files?

You have two choices.
Double click on your project in the main source list to bring up the "Project "myProject" Info" window. Make sure the "General" tab is selected. At the bottom of that tab select "None" from the "SCM Repository" popup menu and close the window.
Or, go to Xcode Preferences window and select the "SCM" tool, select the repository you want to remove, and then remove the repository using the "-" button in the lower left hand corner of the dialog box. This option is a bit more drastic.
These should both leave all of the invisible CVS directories alone. This will allow you to manage the repository from the command line and completely hide the CVS info from Xcode.
Good Luck.

Related

Switching branch on Xcode 9

I am having trouble finding the menu item to switch branch using Xcode 9. The working copies menu seems to have disappeared. Any ideas?
Xcode 9
Xcode 8
Press ⌘2 to open the new Source Control Navigator.
Right-click on the master icon.
To switch to a different branch
Right-click on a non-current branch
Choose Checkout...
Press ↩ or click on the Checkout button.
Expose the left side window (Navigator) in your Xcode by selecting this option (you will see this on the top right side of your Xcode window):
Now select the second tab:
Right click on the branch you are intending to checkout and hit the checkout button from menu:
It seems that Apple has moved Source Controls feature like change branch, version history to separate tab in Navigator area for Xcode 9.x
Below are step to perform branch switch :
Open the Navigator area (if it is hidden) by pressing left pane window present on top right of Xcode or use shortcut cmd + 2
In Source control navigator you can see Branches, Tag present for your project.
Now, if you want to switch branch then select the branch to switch and right click on it.
Select Checkout. This will prompt an alert Do you want to check out “<branch name>”? Select Checkout.
Now this will switch your branch to selected one after sometime.
Note: In order to switch between branches you need to commit or discard changes done in project.
You can even see Log history by selecting branch. Commit history can be viewed based on last 24 hours, last 7 days and last 30 days.
1) Press show navigator button (top right corner of Xcode):
2) Show the project navigator, expand Remotes folder:
3) Expand the origin folder, right click the branch you want to use, and click Checkout....
Follow the below link for the clear explanation of each and every functionality like, Commit, pull, push, etc.
https://www.raywenderlich.com/153084/use-git-source-control-xcode-9

How to force folder refresh in Sublime, when "Project > refresh" doesn't work?

Especially when using an sftp drive (but this problem is also an issue with local drives, although thankfully not as frequent), the folders in the sidebar just keep spinning and spinning, and the "Open Anything" dialog therefore has no files to choose from.
"Project > Refresh folders" does not work in most cases.
I've resorted to restarting Sublime manually, which works most of the time, but it's getting to be a pain to have to do this every other time I switch projects.
Is there any better way to "force" the folders to refresh?
This problem is the reason I asked this question:
How to save project state before exiting in ST3 on Windows?
The SublimeRestart plugin doesn't work on Windows until this project-state-saving problem is solved. However, even if it did work perfectly, it would still only be a workaround for this really annoying non-refreshing-folders issue.
My workaround on Windows, FYI: After loading a project, when the folders don't refresh (don't load even the first time), I have ctrl+f10 bound to "File > Exit", and f10 configured into the shortcut that I launch Sublime Text with. So two reasonably-quick (although additional!) button presses.
Open Sublime Text.
Select Preferences from the top menu and click Key Bindings – User. Here you will see a JSON file that should contain an array of objects (initially the array is empty). Every object will represent a shortcut.
Add the following (new shortcut object) entry into the array (between the brackets):
{
"keys" : ["f5"],
"command" : "refresh_folder_list"
}
You should be able to refresh the folders with F5.
Try to Install this package:
https://packagecontrol.io/packages/SideBarEnhancements
Open the package folder. Main menu -> Preferences -> Package Control: -> Package Control: Install Package
Search the keyword: Side​Bar​Enhancements
Enjoy it
After you install this plugin, you will see the refresh button in your sidebar option:
I have added this myself the other day. I constantly work in an environment where files in the project are changing before I can see them.
Goto 'Preferences' menu -> 'Key Bindings' -> 'User' which will open a JSON file, add below code, save and close that file.
{ "keys": ["ctrl+f5"], "command": "refresh_folder_list" }
It will work like charm 100%. Thanks for asking this question.
This isn't going to be a very useful answer but it documents some early behaviour in Sublime Text that would solve your problem, assuming you need no later features from Sublime Text 2/3 (a big assumption indeed).
Sublime Text 1 had the handy feature in the folder context menu to "Refresh folder". This cause an immediate indexing of only the specified directory (and subdirectories) which was a boon when using networked drives over high-latency connections.
This was deprecated in Sublime Text 2.
Version 1 is available here or by direct download here. It's not clear that these will be available indefinitely though, so this isn't necessarily a long-term solution.

XCode source control: view changes for one file

Is it possible to view a "timeline" (history) for a selected file for like 50 commits? I mean changes made to this particular file and and view commits when they were made and users who changed them? I know Xcode got some powerful version control features, I just can not find this one.
What it sounds like you want is the "Blame View", if we were on the terminal you could write git blame <file-name> to see the commit/time/and user for every single line of a particular file. In Xcode you can accomplish the same thing by activating the blame view. I've posted a picture to show you where the Blame View button resides. From there you should be all set.
For xcode 11.0, If you select a file, changes for that file is available on right panel.
The commit history is in the Version Editor.
Select the file for which you want to see the commit history. Then go to View > Version Editor > Show Version Editor (or just select the Comparison view from the top-right toolbar icon - same place as the Blame view).
Clicking on the commit label below the editor will reveal the history including dates.
Yes. Xcode's Comparison view is exactly for that. When you select a source file, and choose comparison view, you have a time-machine like user-interface that besides letting you compare any two versions of the file, will also present (when you hover) all the commits of the file with their descriptions. This UI opens when you click the clock button in the bottom between the two versions of the .
Pay attention, that Xcode will list all the commits, but will fail to show the content of versions of the file if the file-name or path changed. I think Xcode makers thought that because sources are considered "different" if they are named differently or located differently, there's no point in showing them. It may be, though that they just overlooked the --follow parameter to git.
Xcode 13
Enable Code Review (default: cmd+shift+opt+Enter to toggle)
On the right of the bottom bar (or if you have the debug area opened: the bar that sits on top of it) there are a couple of buttons used for comparing commits: clicking them allows you to pick which commits to use for the comparison on the current file.
Enable Code Review button
Comparison buttons on Debug Area

Xcode: Keyboard shortcuts for navigating changes in the commit view?

When committing files to an SCM in Xcode it brings up its Version Editor with a Comparison View (showing the diffs for each file). If you click in the gutter between files you can quickly navigate between changes using the up & down arrow keys. However, you can't easily move to the next file using the keyboard (as far as I know). It's very tedious to have to use the mouse to click on each file, then click in the gutter, use the keyboard to move between changes and then click on the next file.
Does anyone know of a way to navigate between files in this view using just the keyboard?
I've done some searching & looked through Xcode's Key Bindings preferences but I can't find anything.
It's a bit clunky, but you can press Cmd-Shift-J to go to the current file in the Project navigator, then use the up and down arrows to select different files. From there you can press Cmd-J, Return to put the cursor into the editor view.

Xcode 4 - simultaneous viewing of Project Navigator and Debug Navigator and other Navigators

In Xcode 4 (4.2), is there a way to keep the Project Navigator view open and Debug Navigator view open as well. Must a user have one or the other, but not both? And the other navigators?
Apple seems to have decided that if you want to see the debug view, you don't want to see the files in your project. WTH? Am I getting this wrong? Did Apple Xcode UI guys even talk to developers before designing the UI for Xcode 4?
Sigh...
You can indeed have more navigators open at once, if you are prepared to have multiple windows open. I know it's not exactly what you're asking for, but for multiple display setups it's very handy. Xcode provides "behaviors" to help automate this process if you only want certain things showing at certain times.
For example, a common pattern that developers follow is to setup a behavior for "Run starts" that opens up a new window setup for debugging. Start by creating a new tab in your main Xcode window by pressing command-T, and double-click on the tab's title to rename is "Debug", or whatever you like. Then drag that window out (or leave it as a tab if you like), and customise the view as required - for example, for a deb window you might have the Debug area showing at the bottom (or even covering the whole editor view), and remove the toolbar at the top by right clicking and selecting "Hide Toolbar".
Next, go to "Xcode > Behaviors > Edit Behaviors..." and choose "Run starts" in the left panel. Check the box for "Show tab" and enter the name of your newly created tab. You can also ask that tab to automatically show the Debug Navigator, and show the debugger with variables and/or console view. If you like, you can then choose "Run completes" and show the original "tab" (window), which I've setup to be called "Coding", and show the required navigator (in my case, Project Navigator).
On successfully running, Xcode will now open up your new window (or bring it to the front if it's already open) with all the settings you left it with. On stopping, your main editor will be brought back to the front.
There are loads of useful behaviors, so I would really recommend looking through them and taking the time to setup Xcode to suit your style as best as possible. All software dictates to the user how to go about doing things, and the developers can never please everybody when they decide to change the UI. The best anybody can hope to achieve is to customise the interface as best as they can to fit their style of working. If it's still an issue for you, you can either adapt to it, or, if possible, move to something else.
I'm not a fan of every new interface feature in Xcode, but I've "made it mine" with some customisations and I can still be very productive. That being said there are a lot of things that I do really like about it, and for that I can forgive it for some of the less friendly features - after all, you can't please every user.

Resources