Git push requires username and password

前端 未结 24 2042
灰色年华
灰色年华 2020-11-22 04:14

I cloned a Git repository from my GitHub account to my PC.

I want to work with both my PC and laptop, but with one GitHub account.

When I try to push to or p

24条回答
  •  一向
    一向 (楼主)
    2020-11-22 04:49

     # gen  the pub and priv keys
     # use "strange" naming convention, because those WILL BE more than 10 ...
     ssh-keygen -t rsa -b 4096 -C "me@corp.com" -f ~/.ssh/id_rsa.me@corp.com@`hostname -s`
    
     # set the git alias ONLY this shell session
     alias git='GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa.me@corp.com.`hostname -s`" git'
    
     # who did what when and why
     git log --pretty --format='%h %ai %<(15)%ae ::: %s'
    
     # set the git msg
     export git_msg='issue-123 my important commit msg'
    
     # add all files ( danger !!! ) and commit them with the msg
     git add --all ; git commit -m "$git_msg" --author "Me 

提交回复
热议问题