Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between commits and pull requests

Tags:

github

As I have read that commit means we have updated some code which has bugs and commited that code from where the issue is raised. But what is a pull request.

like image 492
invinciblemuffi Avatar asked Jan 26 '16 06:01

invinciblemuffi


People also ask

Do I need to commit before pull request?

To create a pull request, you must have changes committed to the your new branch. Go to the repository page on github.

Does a pull request create a commit?

These commits will appear in chronological order within your pull request and the changes will be visible in the "Files changed" tab. Other contributors can review your proposed changes, add review comments, contribute to the pull request discussion, and even add commits to the pull request.

What's the difference between a pull request and a branch?

A branch is just a separate version of the code. A pull request is when someone take the repo, makes their own branch, does some changes, then tries to merge that branch in (put their changes in the other person's code repository). (In the most general of terms.)

What does it mean to pull commits?

The git pull command is used to fetch and download content from a remote repository and immediately update the local repository to match the content. Merging remote upstream changes into your local repository is a common task in Git-based collaboration workflows.


2 Answers

A pull request is a way to 'commit' to a repository in which you don't have writing permissions.

The maintainers of that repository will check your request and decide if they either want to merge it with your code or leave the original as it is.

like image 75
Evin1_ Avatar answered Oct 14 '22 18:10

Evin1_


A commit is a discrete change to one or more files. It is a critical part of Git.

A pull request is a request to merge one or more commits into a different branch. It is not part of Git; it is only part of GitHub (and similar services like BitBucket).


See also the Try Git tutorial, in which you can explore some of the differences farther.

like image 23
Aaron Brager Avatar answered Oct 14 '22 18:10

Aaron Brager