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

JavaScript: Object Rename Key

The most complete (and correct) way of doing this would be, I believe: if (old_key !== new_key) { Object.defineProperty(o, new_key, Object.getOwnPropertyDescriptor(o, old_key)); delete o[old_key]; } This method ensures that the renamed property behaves identically to the original one. Also, it seems to me that the possibility to wrap this into a function/method and put it … Read more

Changing column names of a data frame

Use the colnames() function: R> X <- data.frame(bad=1:3, worse=rnorm(3)) R> X bad worse 1 1 -2.440467 2 2 1.320113 3 3 -0.306639 R> colnames(X) <- c(“good”, “better”) R> X good better 1 1 -2.440467 2 2 1.320113 3 3 -0.306639 You can also subset: R> colnames(X)[2] <- “superduper”

Changing capitalization of filenames in Git

Starting Git 2.0.1 (June 25th, 2014), a git mv will just work on a case-insensitive OS. See commit baa37bf by David Turner (dturner-tw). mv: allow renaming to fix case on case-insensitive filesystems “git mv hello.txt Hello.txt” on a case-insensitive filesystem always triggers “destination already exists” error, because these two names refer to the same path … Read more

Is it possible to move/rename files in Git and maintain their history?

Git detects renames rather than persisting the operation with the commit, so whether you use git mv or mv doesn’t matter. The log command takes a –follow argument that continues history before a rename operation, i.e., it searches for similar content using heuristics. To lookup the full history, use the following command: git log –follow … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)