What's Best Practice when you change your script's name?

Being a technical writer, not a programmer, I will often write script with names that make sense to me while I'm working on them, but then later decide the script really needs to be renamed. Before I got involved with using git for version control, I would just rename my scripts if I decided I didn't like the name. With Git (or any other version control software), I'm wondering what others think is a best practice. Is it to just rename it on github, then pull it again locally? or should I change it locally and push out to github, or does it really matter?

Note: I know this really is fringe material for the Ruby list, but I'm hoping that since I'm trying to get more of a best practice type of question, folks don't take an exception to me posting it here.

Wayne

Git tracks the contents of the files, so it's able to follow a rename
perfectly fine.
For example, I created a file called test.txt, and commited it. Later,
I renamed it to renamed.txt, and added it (I also had to git rm
test.txt), the result was:

$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)

···

On Mon, Feb 10, 2014 at 4:06 PM, Wayne Brisette <wbrisett@att.net> wrote:

Being a technical writer, not a programmer, I will often write script with
names that make sense to me while I'm working on them, but then later decide
the script really needs to be renamed. Before I got involved with using git
for version control, I would just rename my scripts if I decided I didn't
like the name. With Git (or any other version control software), I'm
wondering what others think is a best practice. Is it to just rename it on
github, then pull it again locally? or should I change it locally and push
out to github, or does it really matter?

#
# renamed: test.txt -> renamed.txt
#

Jesus.

If you (the OP) are interested in the actual background and sementics, you can
read a question on Stack Exchange regarding this at
<git mv - What's the purpose of git-mv? - Stack Overflow,
which explains that "git mv" exists and is actual a shortcut for "mv $old
$new; git rm $old; git add $new".

There's a git faq entry at
<Git FAQ - Git SCM Wiki,
and a lengthy explanation by Linus at
<http://permalink.gmane.org/gmane.comp.version-control.git/217&gt;\.

The short answer is exactly what Jesus said: Git tracks contents, not files.

HTH.

      --- Eric

···

On Monday 10 February 2014 16:40:34, Jesús Gabriel y Galán <jgabrielygalan@gmail.com> wrote:

Git tracks the contents of the files, so it's able to follow a rename
perfectly fine.

Thanks all! Just wanted to make sure I didn't end up hosing myself by doing the wrong thing.

Wayne

···

________________________________
From: Eric MSP Veith <eveith@wwweb-library.net>
To: Ruby users <ruby-talk@ruby-lang.org>
Sent: Monday, February 10, 2014 9:58 AM
Subject: Re: What's Best Practice when you change your script's name?

On Monday 10 February 2014 16:40:34, Jesús Gabriel y Galán <jgabrielygalan@gmail.com> wrote:

Git tracks the contents of the files, so it's able to follow a rename
perfectly fine.

If you (the OP) are interested in the actual background and sementics, you can
read a question on Stack Exchange regarding this at
<git mv - What's the purpose of git-mv? - Stack Overflow,
which explains that "git mv" exists and is actual a shortcut for "mv $old
$new; git rm $old; git add $new".

There's a git faq entry at
<Git FAQ - Git SCM Wiki,
and a lengthy explanation by Linus at
<http://permalink.gmane.org/gmane.comp.version-control.git/217&gt;\.

The short answer is exactly what Jesus said: Git tracks contents, not files.

HTH.

        \-\-\- Eric