1

I'm collaborating to a Django project whose database is hosted by PythonAnywhere. From this project, a private repository has been created on GitHub. I then got invitation to that repository as contributor.

I then logged to PythonAnywhere and tried to push using my GitHub credentials, but it didn't work as the image shows.

Push test

I read here that remotes should be added to let collaborators pull/push. I cloned the repository but I think this is not the way. I also tried to check this SO question but frankly I'm a novice in that and I didn't solve my problem.

Here's the question: is there a way to set up a configuration such that each contributor can push to the repository with its own credentials, so to track who did what?

Community
  • 1
  • 1
Mattia Paterna
  • 1,268
  • 3
  • 15
  • 31
  • 1
    I'm confused. The image you shared appears to show a _successful_ push to Github. Can you explain in more detail what you expected that did not happen? – Dan Lowe Apr 26 '17 at 13:33
  • 1
    One thing: The credentials used to authenticate to be able to push on a remote have _no_ relation whatsoever with the authors/committers of revisions. – eftshift0 Apr 26 '17 at 22:46
  • @DanLowe sure: I got a successful thing but *not* with the expected Author. Since I used my username and password for GitHub, I was expecting myself as author (*inspiralpatterns*) and not *percanecto*. – Mattia Paterna Apr 27 '17 at 07:45
  • @Edmundo could you please elaborate a bit on them? I understood something like: *'you can use whatever username and password but eventually the Author will be always the one specified in the `.git/config` file`*. But I'm not completely sure. – Mattia Paterna Apr 27 '17 at 07:48
  • @Edmundo and, if so, is it possible to add more than one option for authentication? – Mattia Paterna Apr 27 '17 at 09:43
  • 1
    @MattiaPaterna "is there a way to set up a configuration such that each contributor can push to the repository with its own credentials, _so to track who did what?_". The problem is in the assumption that by asking people to authenticate, you will know who did what.... and that's not the case. You could push things into a remote branch that actually don't belong to you. What anyone did doesn't depend on authentication but on who ***committed*** what (and there's no need to authenticate for that). – eftshift0 Apr 27 '17 at 15:12
  • @Edmundo makes perfectly sense, thanks for explanation. However, it turns out that using `git commit --author="Name "` works in showing the committer but on Github the commit is registered as *committer with (authenticated user)*. That is, the total number of contributors does not change. I'll maybe write an answer below, even though it is not exactly what I was looking for. – Mattia Paterna Apr 27 '17 at 16:01

0 Answers0