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"
You need to tell your shell to execute the date
portion of your command, probably using backticks or $(...)
, eg:
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.