How to rename rails controller and model in a project

Here is what I would do: Create a migration to change the table name (database level). I assume your old table is called corps. The migration content will be: class RenameCorpsToStores < ActiveRecord::Migration def change rename_table :corps, :stores end end Change your model file name, your model class definition and the model associations: File rename: … Read more

Renaming branches remotely in Git

You just have to create a new local branch with the desired name, push it to your remote, and then delete the old remote branch: $ git branch new-branch-name origin/old-branch-name $ git push origin –set-upstream new-branch-name $ git push origin :old-branch-name Then, to see the old branch name, each client of the repository would have … Read more

Renaming Files with Excel VBA

I think you could do something like this, using the Name function to rename the files, however, you will probably need to make sure the 2 columns have the complete file path, i.e. “C:\Temp\ABC.jpg” Dim Source As Range Dim OldFile As String Dim NewFile As String Set Source = Cells(1, 1).CurrentRegion For Row = 1 … Read more

How to rename a file on sdcard with Android application?

I would recommend using File.renameTo() rather than running the mv command, since I’m fairly sure the latter isn’t supported.. Have you given your application permission to write to the SD Card? You do this by adding the following to your AndroidManifest.xml: <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE” /> If it doesn’t work once the permission is added check the … Read more

Renaming multiple files in a directory using Python

You are not giving the whole path while renaming, do it like this: import os path=”/Users/myName/Desktop/directory” files = os.listdir(path) for index, file in enumerate(files): os.rename(os.path.join(path, file), os.path.join(path, ”.join([str(index), ‘.jpg’]))) Edit: Thanks to tavo, The first solution would move the file to the current directory, fixed that.

Disable Git Rename Detection

Update Sept. 2021: The 2016 option mentioned below is now obsolete, and replaced by the new merge strategy ORT (“Ostensibly Recursive’s Twin”), which does a much better job handling rename detection. The primary difference noticable here is that the updating of the working tree and index is not done simultaneously with the merge algorithm, but … Read more