0

The author of a repository on Github asked for contribution on his project by translating some language files. I tried to collaborate by doing the following steps:

  1. Clone the repository and make a Pull
  2. Create a branch "German_locale"
  3. Made changes to language files
  4. commit while adding a message
  5. Push branch to origin (failed)
  6. Intended final step: pull request on Github website

However, the 5. action fails. It asks for Username /Password and doesn't give me access if I'm providing my personal. I think, the system tries to verify me as the original author, which I am not.

The very basic questions are (sorry, I'm new):

  • What do I have to do in order to push a branch to a foreign repository? Do I have to ask for being a collaborator first? This doesn't seem right.

  • Would it be a better idea to create a fork in the first place? This doesn't seem right, either.

I'm using SmartGit as a client, so please describe the solution rather then providing command lines. I really want to understand how that works. I have seen other contributors translating other language files on this project successfully but have no idea how that works in general.

agoldev
  • 2,078
  • 3
  • 23
  • 38

3 Answers3

1

First, the owner of the repository should add you as a collaborator. Then you will be able to push changes to a remote Git repository.

AziZ
  • 149
  • 1
  • 12
1

Typically in these situations, especially if we're talking about contributing to an open source project, you should fork the project, work on master, and then create a pull request from your fork to the original project.

Of course "typically" is not always. Read the contribution guide of the project (if available) or ask the owner to give it to you so that expectations are clear.

Forking, if you are unfamiliar with it, is like remote cloning ( a copy of the original project is made under your namespace in github ) and you only work on (clone) the fork locally on your workstation.

Forking is not a git client operation so it needs to be done on the server interface (github.com in this case).

  • Unfortunately, there is no guide. He just says in the README.md: "Open your language files use links above and edit." and "Save your work." LOL To me, forking seems more appropiate if I want to take the software and make a fundamentally different product out of it. Also, pull requests can not be made on forked clones, right? – agoldev Dec 04 '17 at 13:39
  • @agoldev, Forking can be used to make another software, but it's also a common way to contribute - https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project See my answer below – Alex Mozharov Dec 04 '17 at 14:16
  • @agoldev, for the last question about pull requests - you need to push to your fork remote on github and then create a pull request on github.com. See this: https://help.github.com/articles/creating-a-pull-request-from-a-fork/ – Alex Mozharov Dec 04 '17 at 14:19
0

As for github, there is another way to contribute.

  1. Fork the original repo. This will create the same repository in your github account with reference to original. Now you have your own repository, so there will be no push fails.
  2. Do your changes, commit and push them to your fork.
  3. Navigate to github.com and create a pull request, so the author of the original repo can review and accept (or decline) your contribution.

Git official tutorial

Alex Mozharov
  • 446
  • 6
  • 16