-1

A rather odd application I suppose...but how can I add a timestamp to git clone for a Filemaker file.

Ideal on my MAC I'd like to use something like:

sudo git clone -l -s -n . ../Dev_copy_[date_time]

I've tried the follow:

sudo git clone -l -s -n . ../Dev_copy_date_+%F_%T

But it give me a literal clone

 "Dev_copy_date_+%F_%T"
i am me
  • 89
  • 1
  • 14
paulywill
  • 629
  • 10
  • 29

1 Answers1

1

You need to tell your shell to execute the date portion of your command, probably using backticks or $(...), e.g.:

git clone -l -s -n . ../Dev_copy_`date "+%F_%T"`

Note that date is not connected to the date format string.

As a side note, running something like git with sudo is almost always a mistake. Try running this without sudo.

Also, please note that the copy you're cloning from in the current directory already contains a complete history of your commits. I'm not clear on what the benefit of manually creating a new copy with a manual timestamp is.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257