GitHub uses my personal account when pushing even though the repo is private and solely my work github account has rights

If I clone using my personal account, it doesn’t work. It says it can’t find the repo. Makes sense, the repo is private and my personal account is not in it.

So I use:
git clone https://<token>@github.com/.../....git with a token I generated on my work github account.

This works.

Now if I make a modification and push (git add ., git commit -s -m "something", git push), it works, but on the repo, it shows up as if my personal account had made the pushes even though this account does not even belong to the repo. I insist, the token I use is not linked to that personal account.

I’m a bit confused as to what I should do. I think the git credential manager messes things up but I’m not sure how. Also, how does it even work since I shouldn’t even have the “rights” to push in that repo with my personal account? Is the token used to bypass security and then what is displayed not even “controlled”? By this I mean does GitHub allow the push event thanks to the token but the commit itself contains author information from the local Git configuration that may not be matching??

3

I would have preferred to comment but I don’t have enough reputation

Not sure of my answer but a few hints that might help to understand.

When you commit, Github use 2 information:

  • Authentication: This is handled by the token you use. The token is associated with your work GitHub account, which has the necessary permissions to push to the repository.

  • Commit Author Information: This is determined by the configuration of your local Git environment. It uses the name and email address configured in your Git settings.

It seems that your local Git configuration is using the email address associated with your personal GitHub account.

You can check your Git configuration with:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>git config --global user.name
git config --global user.email
</code>
<code>git config --global user.name git config --global user.email </code>
git config --global user.name
git config --global user.email

Depends on the result you can update it:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>git config --global user.name "Right Name"
git config --global user.email "[email protected]"
</code>
<code>git config --global user.name "Right Name" git config --global user.email "[email protected]" </code>
git config --global user.name "Right Name"
git config --global user.email "[email protected]"

But if you don’t want to change your global configuration, you can set the author information for one repositories:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>cd path/to/your/repository
git config user.name "Right Name"
git config user.email "[email protected]"
</code>
<code>cd path/to/your/repository git config user.name "Right Name" git config user.email "[email protected]" </code>
cd path/to/your/repository
git config user.name "Right Name"
git config user.email "[email protected]"

New contributor

Laulee is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

3

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật