Volt regen egy arpitest nevu userem githubon, csak mas projektekhez commenteltem/bugreportoltam vele, gondoltam regisztalok egy ujat, amibe majd a sajat fejleszteseim publikalom. El is kezdtem felpakolni a forrasokat, de veletlen (credential cache miatt) meg a regi userrel. Es siman engedte, en is csak utolag vettem eszre. Szoval egy "idegen" user tud az en repomba commitelni a main-be? WTF?
Teszteleshez csinaltem egy repot:
https://github.com/gereoffy/proba/
ebbe is siman ment a commit arpitest-el. Ezutan a settings-ben felvettem egy "Branch protection rule"-t ahol [X]-eltem a " Require a pull request before merging " opciot. De meg ezutan is siman tudtam commitelni bele, csak kiirt egy warningot de megcsinalta:
# git commit README.md
# git push -u origin main
[main 60da6bd] updated 2 :)
1 file changed, 2 insertions(+), 1 deletion(-)
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Writing objects: 100% (3/3), 281 bytes | 281.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Bypassed rule violations for refs/heads/main:
remote:
remote: - Changes must be made through a pull request.
remote:
To https://github.com/gereoffy/proba.git
57997cd..60da6bd main -> main
Branch 'main' set up to track remote branch 'main' from 'origin'.
szerk: kiprobaltam egy masik geprol (amin sose hasznaltam git-et) es ott nem engedte, ezt irja:
# git push -u origin main
Username for 'https://github.com': arpitest
Password for 'https://arpitest@github.com':
remote: Permission to gereoffy/proba.git denied to arpitest.
fatal: unable to access 'https://github.com/gereoffy/proba/': The requested URL returned error: 403
- 217 megtekintés
Hozzászólások
Szerintem a local git configban maradt az arpitest user, de a github felé az új user credentialt használja:
Why are my commits linked to the wrong user?
How to Spoof Any User on Github…and What to Do to Prevent It
- A hozzászóláshoz be kell jelentkezni
koszi, ez volt a gond. git config --global user.name beallitas utan mar jo lett.
azert ez akkor is kicsit fura, hogy barmilyen usert be lehet hazudni egy commithez...
- A hozzászóláshoz be kell jelentkezni
hat ez igy van jol. ha egy forkbol osszeszedsz par commitot merge-vel (akar ff, akar no-ff modban), akkor azt nem tudnad a sajat repodba pusholni... elvileg a signed committal tudnad hogy azt a commitot valoban xy csinalta.
Te repod: A - B - C - D(master)
\
Valaki mas forkja: E(master)
egy merge ff + push utan
tied: A - B - C - D - E (master)
\
masik: E(master)
egy merge noff (de itt is a repod resz az "idegen" E):
tied: A - B - C - D ------- F (master)
\ /
masik: E(master)
A vegtelen ciklus is vegeter egyszer, csak kelloen eros hardver kell hozza!
- A hozzászóláshoz be kell jelentkezni
a commit olyan neven van ahogy akarod. az a kerdes hogy pusholaskor melyik kulcsot hasznalod.
en az ilyenek elkerulese vegett hasznalok "fake" hostneveket (.ssh/config):
Host valamiuser1.github.com
User git
Hostname github.com
ForwardAgent no
IdentityFile /home/elbandi/.ssh/id_rsa_valamiuser1
Host valamiuser2.github.com
User git
Hostname github.com
ForwardAgent no
IdentityFile /home/elbandi/.ssh/id_rsa_valamiuser2
ezutan a clone mindig a fakehost alapjan van:
git clone git@valamiuser2.github.com:valamiuser2/repo.git
A vegtelen ciklus is vegeter egyszer, csak kelloen eros hardver kell hozza!
- A hozzászóláshoz be kell jelentkezni