Can I accept a pull request locally? Via terminal or Github desktop?

Asked

Viewed 668 times

9

I can accept pull request open locally, via terminal or Github desktop.

  • 2

    As far as I know Pull Request is not exactly git, but aggregators like Github, Gitlab, etc... Github has a tool per command line that can help you.

  • When you say yes, do you mean evaluate the changes and "merge" with the master branch via git? Or you refer to comment on the lines that need to be improved, that is, perform code review?

  • 1

    adding to the above comments, "accept pull request" is nothing more than merging the source branch with the target branch, pull request is just a concept or a function that exists or does not exist where its source was stored, that is, a pull request does not exist inside git only in the program you use to control, imagine if you make a git server without visual interaction, how would you pull request? created a Feature coming out of develop, I made the Feature and I want to return through pull request, so I push and warn the guys that have a fetch waiting to merge in develop, this is a PR

1 answer

6


First let’s define what use is the pull request

Pull requests allow you to inform other people about the changes you have made push for a branch into a repository on Github. After a pull request is open, you can discuss and review possible changes with contributors and add commits follow-up before the changes take place merge in the branch groundwork.

Based on this statement: how to accept a pull request locally? Terminal: The Answer is Yes.

Let’s assume as interaction branchs: master and new-branch. Once the pull request (PR) of new-branch created, and can be via git, to accept the PR in master follow the steps:

  1. Update your local branch by downloading objects and references from another repository, that is, you want to see new-branch newly created on the basis of master, just enter the command gti fetch -pt;
  2. To view changes to new-branch will cause in the master use the command git diff. In this case we want to do the code review of the changes and see the difference between the two branchs, apply the command git diff master..new-branch;
  3. After analysis, merge into the master: git merge new-branch. Note: You must be in master to execute this command.
  4. Now it’s just left to send the changes to the remote: git push origin master. Your PR will pass status OPEN for MERGED.

See the test in sequence. I reran the process described above and it worked as if I had accepted the PR.

Follows Images inserir a descrição da imagem aqui inserir a descrição da imagem aqui

About doing the process via Github desktop, I’ve never used, just command line, so I don’t have the property to talk.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.