Gavin
Gavin

Reputation: 2824

Android github push and pull

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?

Upvotes: 1

Views: 2127

Answers (2)

RicoBrassers
RicoBrassers

Reputation: 91

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.

Upvotes: 0

Ankit Khare
Ankit Khare

Reputation: 1385

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>

Upvotes: 1

Related Questions