search

Home  >  Q&A  >  body text

How to perform git operations with shell

Can’t write shell, please help me,
I can only execute a few git commands

cd /home/xx
git add .
git commit -m '时间,如2016-03-03 12:0:03'
git push origin master

Resolved

cd /hmoe/xx
backtime=`date +%Y%m%d%H%M%S`
git add .
git commit -m bk_${backtime}
git push origin master
大家讲道理大家讲道理2827 days ago644

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-05-02 09:32:36

    You also need to create a remote library,
    git remote add origin "xx"
    The double quotes are the .git file of the remote git, such as
    https://github.com/yourname/yourproject.git

    reply
    0
  • 为情所困

    为情所困2017-05-02 09:32:36

    I wrote a similar script in php.

    reply
    0
  • Cancelreply