In GitAhead, how do you open a single file from a specific commit? - gitahead

In GitAhead, I would like to open/download/save a file from a specific commit.
In sourcetree, slecting a fil gives you two buttons: "Open before" and "Open after".
I'm looking for something similar.
Is there a way to open a specific version of a specific file, without having to checkout the whole commit?

It's not as obvious as it should be. Navigate to the commit that changed the file. Press and hold the pencil icon in the file's header widget. You should see a menu pop up with options to edit the new and old revisions. The old revision is the file as it existed before the change, and new is the file after the change. Unfortunately, as there is no "Save As", you would have to resort to copy/paste to save.
The other option is to switch to the tree view. That shows arbitrary files as they existed in a given revision. If you want to get a file's contents before the change, you have to switch to the parent commit.

Related

File won't save as .css (sublime)

I'm new to web development and I'm just starting to learn CSS. I am having a problem where I can't get any of the styling to work. At first I thought I didn't link back to the style sheet correctly, but now I'm seeing that my css file isn't saving as .css. I keep going to save as, select .css and then I go back to look for it under that file type and it's not there. When I click on it to view the properties in the folder, for the type it just says "file". I've tried several times to save it again as .css and nothing. Does anyone know what could be going on here?
Edit: I tried to save it as HTML now and it wouldn't work either. Everything new I am saving is saving as a plain "file" now and I don't know why.
everytime you want to change the ending yourself, select "Save as", type the "file name + ending" and make sure always to check "Save as Type: All files".
You can also just type the "file name" and select the file type in "Save as Type: for example .css / .html"
Beginners' tip: If you are new to web development, I recommend the notepad. Every careless mistake that you notice here is golden for your future overall knowledge.

Trying to persist CSS changes to file on disk in Chrome Dev tools

I have just started exploring the possibility of saving changes made to a page and it's styling in Chrome Dev Tools on the fly.
I've followed this short video tutorial on mapping the project files on disk to the Dev Tools via the Sources tab. Everything works fine until around the 5:17 point where he selects an element in the Elements tab and makes several CSS style changes which automatically persist to the file on disk.
This doesn't work for me. The changes won't save to the file and when I refresh the page reverts to the original styles. I have checked to see if there is an asterisk beside the corresponding CSS file in the Sources panel, to denote changes have been made, but there is nothing there.
I have also tried the solution posted in this SO question but I don't see the link to the stylesheet after editing the style in the Elements tab that will redirect back to the file in the Sources tab allowing the changes to be saved.
Can anyone tell me what I am missing? Thanks!
You need to make sure you map your Workspace to a Network Resource to persist changes automatically. I have produced the steps below to get this working correctly.
Select the folder in Sources and click 'Add Folder to Workspace'
If you open up our stylesheet in Sources and go to the Elements panel to make changes, upon coming back you will see a separate instance of the stylesheet opened with pending changes. The reason is that Chrome doesn't know how to map the URL to the file on your system yet.
Select 'Map to Network Resource...'. You will notice that 'top' disappears.
Make a change in the Elements panel now. When you go back to the Sources panel, the changes will automatically be shown without requiring any explicit save.
You can see exactly what was done by going to the Workspaces section of the DevTools settings panel. We've added a local Workspace, and then mapping the URL, which in my case is on my computer and accessed with the file:// protocol, to the relative path on the system.

Possilble to auto open a downloaded word document downloaded in browser

The requirement is sent a Word document from browser, and automatically open it on MS Word so that then can view and edit the Word document.
The only solution I can found require the end user to click a dialogue Window in order to open a Word document in Office when the document is download from browser.
Is this the only way, that the user has to click a dialogue Window before Office can open the downloaded Word document?
It kinds of make sense for security reason to not let browser automatically execute an local application (Word.exe) on the local machine, but I still want to confirm that.
If the answer is yes, then I would like to know how to do that?
Edit: I just found out that you have to use inline instead of Attachement, otherwise it will always ask for the option event the browsers are setup properly.
Response.AddHeader("Content-Disposition", "inline;filename=clientquotes.docx");
After made that change, browser will auto open the Word document without asking for action.
If I understand correctly, you want to change the behaviour of your browser to automatically open downloaded files. As far I'm aware its pretty painless process when it comes to Firefox and Google Chrome, however on IE it's not as simple.
Firefox
Changing download actions
This will not affect media embedded in a web page - only links to the files themselves.
Click the menu button Menu and choose Options
Select the Applications panel.
The Applications panel will display. Select the type of file for which you want to change the default action.
The Action column will give you a drop-down menu, with options on action to take, whenever you click that type of file.
Alwaysask: will prompt you to select what action you want Firefox to take when you click on that type of file. This can be useful if Firefox is automatically saving a file type or is always opening it with a certain program and you want to be asked what to do.
Save File: will always save the file to your computer using the Downloads window, whenever you click that type of file.
Open the file with an application or plugin of your choosing.
Click Ok to close the options window after making changes
Adding download actions
On the web, find a link to a file matching the type you want to add.
Click on the file link to download it.
Select how you want Firefox to handle the file:
Open with: Saves the file to a temporary folder and opens it in the default application for that file type. To select an application, click Browse....
Do not choose Firefox to always open a certain file type, as doing so can cause
a problem where Firefox repeatedly opens empty tabs or windows after you click on a link.
Save file: Saves the file to the download folder (specified in the Firefox General panel).
In the Opening file window, check mark Do this automatically for files like this from now on.
Click Ok.
Is Do this automatically for files like this from now on disabled?
This can happen if the website's server incorrectly specifies the
Internet Media type of the file. It also can happen if the server assigns
"Content-Disposition: attachment" to the file.
Reference
Google Chrome
If you want certain types of file always to open after they've finished downloading, click the arrow next to the file button in the downloads bar and select Always open files of this type.
Reference
IE
From what I can gather for IE you will have to change the registry keys. You can refer to this link for further information.
I hope this answers your question.

Firebug FireDiff - how to save entire CSS file?

I'm modifying CSS using Firebug and FireDiff. I've had a couple of 'accidents' where I have 'saved a snapshot' but in fact just saved a diff (one or two changes), uploaded it to my web server and overwrote the full CSS file with a snippet. Fortunately I have been making periodic backups.
Question: how do I ensure that I save the whole file - either using Firebug itself or FireDiff?
Firebug
With Firebug itself you can save the CSS following these steps:
After you've made your changes switch to the CSS panel
Select the modified CSS file from the CSS Location Menu
Press Ctrl+A to select the whole CSS and copy it via Ctrl+C or by right-clicking on the selection and choosing Copy from the context menu
Paste the CSS into the text editor of your choice and save it
FireDiff
With FireDiff the steps are a bit different:
After you've made your changes switch to the Changes panel
Within the change log right-click on the CSS change you've made to the file you want to save and choose Save Snapshot from the context menu
Enter a file name into the save dialog and save the it
Notes:
FireDiff requires another extension called Fireformat to save snapshots.
As the word 'snapshot' indicates FireDiff saves the file including all changes up to the one you've chosen. If you want to save the current state of a file, you need to choose the last change to that file.
For both methods you need to take care in which file the CSS was saved. In case of inline CSS, i.e. CSS included in the HTML output via the <style> tag you need to save the CSS back to the HTML output.
Other extensions
Besides doing this in Firebug or using FireDiff there are Firebug extensions, which claim to allow you to upload your changes directly to your server via FTP. These extensions are cssUpdater and FireFile. Though they seem to not be maintained anymore and may not work with current versions of Firebug.

Can't Rename Files In Xcode 4 Anymore?

Seriously, in previous versions of XCode I could right-click a file or group in XCode and I would get the "rename" option. In XCode 4 I can't seem to rename my files in XCode directly anymore. What happened? Why would Apple remove such a feature? How can I rename my nibs, image resources, and others in XCode now?
Note that if you're renaming a class, the best way I've found to do this is to open the class header, select the name of the class then control-click and choose Refactor / Rename. That way Xcode will rename the .h and .m files and replace instances of your class name (almost) everywhere it appears, including XIB files. Nifty!
Edit: in Xcode 4.2, watch out for this gotcha: "When initiating a refactoring rename operation from the declaration of a property, any Interface Builder files that refer to that property will not be updated correctly. Instead, perform the rename operation on a usage of the property, or an associated #synthesize statement."
The contextual menu item was removed, but you can still rename from within. Select the file and then click again in the name and you should get the editor field. Type away to rename. It can be a little temperamental though. The biggest problem I usually have is doing the 2nd click too quickly and it being registered as a double click. So you might need to play around with your timing a little bit to get used to it.
If you want the CM item back, make sure to file a bug report on it.
Select the file in the navigation window and press Enter.
Just the way renaming in Finder.
In case you want to change the path in case you moved some files...
Step 1: View -> Utilities -> File Inspector to open the file inspector
Step 2: Under Identity -> Path there is a white icon to change the relative path of the file
Furthermore, to rename the file, just refactor as stated above ;)
another way you can do it, is by using the little rectangle with an arrow in it which is at the bottom of the bar. Click on it, your items will be displayed in a list like view, you can rename it there the way you would rename files or whatever... Hope that helps
If you want to rename non-class files like png files just select file and choose 'Show File Inspector' from right click, then change file name from 'name' textfield (identify and type label).
I you want change class name, I recommend 'Simon Whitaker' Refactor method (second comment).

Resources