1

First time using git and github for my small android project that I will be the base user. The rest of the team will have to submit a pull request for me to review.

I created a project and have the others forked the project. When I committed and pushed new content to my repo and notify my team members to update their copy. They clicked the blue down arrow on android studio but they can't seems to be able to update by pulling from me? It just says the "All files are up to date".

They are also not able to push. "Failed with error: fatal: unable to access 'https://github.com/groupmemberusername/project.git/': The requested URL returned error : 403"

From my understanding is that a pull request is something for you to notify the original base repo creator(which is me) to review and thus decide whether to merge the changes to the original repo. Is this understanding wrong?

Gavin
  • 2,784
  • 6
  • 41
  • 78

2 Answers2

1

Here is the steps to create pull request

  1. git checkout -b "sub_branch_name_created from base branch"
  2. git add Foo.java
  3. git commit -m "message"
  4. git push origin "sub_branch_name_created from base branch"

Now open gitHub and there would be your commit listed, click on it there you can see a button named "New pull Request" click on that, then all you have to do is select the base branch and the branch you just created.

That's it.<code>[![enter image description here][1]][1]</code>

Ankit Khare
  • 1,345
  • 11
  • 30
0

Yes, you are correct. a pull requestis issued by the owner of a fork (clone) from the original project (or from a separate branchof the original project), to inform the project owner/leader, that someone has made a change, that should be reviewed.


Generally, there are 2 options, where a pull request can be made.

Same project, different branch

One project can have different branches. Example: You (the project owner) control the masterbranch. Your team members have no writing permissions for the masterbranch, but they can create a branch, where they have full access (e.g. projectname-membername). The code modified in the separate branch are not reflected in the master branch.

In this case, your members should doublecheck, if they are pushing/pulling from/to the master branch, they might not have the permissions to read/write.

Different project (fork)

In your specific case, your team members created a fork, a separate project, copying the codebase of the original project (called upstream).

Without having full-access to the upstream project, your members have full-access to their fork, which can be merged with the upstream project after you reviewed it (pull request).

Your members should doublecheck, that they are pushing to their own fork, not the upstream project. Please note, that they should pull from their own fork (working on another computer, for example), and do a pull request to get their changes into the upstream project.

Edit: If you make changes to the upstream project, your members have to fetch the changes from upstream and do a manual merge with their local changes.

RicoBrassers
  • 91
  • 1
  • 8
  • @On the part of if I(owner) make changes to the `upstream` project. My members have to pull changes from `upstream`. Right now whenever I write changes to the `upstream` project. They have to go to their forked repo and submit a pull request and approve it, only then will their forked repo update to the updated `upstream` version. That seems a little weird to me? – Gavin Aug 31 '16 at 11:49
  • @MaTaKazer No. Actually, your members should `fetch` the changes from `upstream` and then do a manually `merge`, otherwise, their (local and uncommitted) changes get lost. Give me a second to clarify this in my answer. The fork _never_ updates to the `upstream` version. You have to get the current version of `upstream` locally and manually `push`it to the fork. – RicoBrassers Aug 31 '16 at 11:57
  • The forked repo is actually having issue trying to `fetch` updated changes from `upstream` - It just says "All files are up to date." on Android Studio. So I was playing around with all the function over at the github website and concluded with the previous reply. – Gavin Aug 31 '16 at 12:16
  • @MaTaKazer That's why I wrote, that you and your members should check, whether you try to `pull` or `fetch` from `upstream` or from the `fork`. If you made changes to `upstream` and your team members try to fetch from their fork, then they can't get the changes that were made to `upstream`. The fork is basicly a copy of `upstream`, but they are not bonded together, even though GitHub markes forks as such. – RicoBrassers Aug 31 '16 at 12:21
  • Alright I am able to rebase my forked repo right now. But I have no idea why my group members can't `push` their update to the forked repo. It keep saying Error 403 as per mentioned on my initial question. I have checked that it is indeed pushing to their forked repo and not the original `upstream` – Gavin Aug 31 '16 at 13:52
  • @MaTaKazer Have your members entered their correct github credentials (https) or their correct key (ssh)? – RicoBrassers Aug 31 '16 at 13:59
  • @MaTaKazer Also check out this [answer](http://stackoverflow.com/a/5343146/6774296). – RicoBrassers Aug 31 '16 at 14:05
  • @I am using Android Studio With Github integration and not using command line. Have checked that I am indeed logged in to the forked repo github account. Not sure if you are familiar with it. If not I could probably try your first suggestion "Same project, different branch" - that sounds a lot simpler – Gavin Aug 31 '16 at 14:25
  • @MaTaKazer It doesn't matter, whether you are using Android Studio. In the dialog, where you have to put the GitHub URL, you simply add `username@` between `https://` and `github.com/...`. – RicoBrassers Aug 31 '16 at 15:06
  • For some reason when I tried to clone the same repo on another computer with also another github account. Somehow I can push to it without any issue. I am very puzzled right now as isn't it suppose to be protected from push from the public? – Gavin Aug 31 '16 at 15:26