remote: GitLab: Author ‘xxx‘ is not a member of team(Git修改和配置本地用户名和邮箱)
生活随笔
收集整理的這篇文章主要介紹了
remote: GitLab: Author ‘xxx‘ is not a member of team(Git修改和配置本地用户名和邮箱)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
git push失敗,顯示以下消息:
Enumerating objects: 11, done. Counting objects: 100% (11/11), done. Delta compression using up to 8 threads Compressing objects: 100% (6/6), done. Writing objects: 100% (6/6), 2.33 KiB | 2.33 MiB/s, done. Total 6 (delta 4), reused 0 (delta 0), pack-reused 0 remote: GitLab: Author 'lvsige_lsg@163.com' is not a member of team! [remote rejected] lsg_pinCode_201117 -> lsg_pinCode_201117 (pre-receive hook declined) error: failed to push some refs to 'gitlab.2dupay.com……'git在push/push to時需要使用到user.name和user.email,切記一定要配置好
查看user.name/user.email
git config user.name git config user.email查看所有配置信息
git config --list配置user.name/user.email
git config user.name "newName" git config user.email "newEmail"加上–global可以全局修改,否則僅在本git-repo生效。
配置全局user.name/user.email
git config --global user.name "your user name" git config --global user.email "your user email"這里需要注意的是,該命令只能用于初次配置user.name/email,如果不小心配置錯誤,或者重復(fù)配置,不可以通過重復(fù)執(zhí)行以上命令來修改user.name/email,否則可能或報錯說無法重復(fù)配置,或者導(dǎo)致一個key配置了多個value。
修改user.name/user.email
如果想要修改已經(jīng)配置過的user.name或email,有兩種方式,一種是通過git bash來修改;一種是直接修改.gitconfig文件。
該文件是隱藏文件,位于C:\Users{user}.gitconfig,直接修改里邊的name或者email,如果有重復(fù)的name或email,可以將其刪掉,只剩下一個就好。
修改完,通過git bash輸入git config –list可以查看是否修改成功了。
修改最近一次commit的user.name/user.email
git commit --amend --author="userName <userEmail>"注意不能缺少< >
此指令僅能更新最近的一次commit的用戶名郵箱
注意:到這里還是沒有解決問題 無法push成功
可以嘗試重新clone項目 重新push
總結(jié)
以上是生活随笔為你收集整理的remote: GitLab: Author ‘xxx‘ is not a member of team(Git修改和配置本地用户名和邮箱)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 用友发布企业服务大模型YonGPT
- 下一篇: 使用 .toLocaleString()