search

Home  >  Q&A  >  body text

dos - How to enter username and password for batch file git operation

It is troublesome to write many git commands every time, so I want to use bat instead. However, after executing git push, I need to enter the user name and password. How can I make the bat file automatically fill in this?

My current bat file content is as follows:

cd 要提交的项目目录
git pull
git add .
git commit -m "update"
git push -u origin master
我想大声告诉你我想大声告诉你2830 days ago963

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-05-02 09:44:13

    You don’t need to enter username and password when using ssh
    http://yansu.org/2013/04/22/i...

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-02 09:44:13

    It is recommended not to use http authentication. You can use ssh authentication without entering a password

    git remote add origin-ssh git@github.com:<Username>/<Reponame>.git 
    git fetch origin-ssh <branch-name>

    reply
    0
  • 黄舟

    黄舟2017-05-02 09:44:13

    Don’t use https, otherwise you will be prompted to enter the username and password over and over again.
    Just configure ssh.
    Refer to this article by coding

    reply
    0
  • Cancelreply