I am pretty new to git & github. Also my english is bad, so I need to explain it in a weird way.
Is this possible? My git didn't ask for a password, or github didn't ask for a merge request?
If it's possible, How can we be protected?
I think you are confusing two questions.
Is it possible to push as someone else?
No, it is not - you would need their GitHub credentials to do that (their PAT or their ssh key).
Is it possible to create a commit with someone else's name as author?
Yes*, you can set any author e-mail and name in your commits, but that's all that the git config lets you set - what goes into the commit, not credentials.
(*) that's only a partial yes: you can't sign a commit as someone else, so if you create a commit showing someone else as author, you would not be able to prove they had created that commit (unless you actually had access to their GPG key, but just like passwords, that's a secret that should never be shared).
So to your last question, you can protect yourself from forgery:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With