19

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.

invinciblemuffi
  • 908
  • 1
  • 11
  • 22

2 Answers2

30

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.

Evin1_
  • 12,292
  • 9
  • 45
  • 47
30

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.

Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
  • Thank you for bringing up and explaining this simple difference – invinciblemuffi Jan 26 '16 at 06:29
  • If I need to commit on master then what is to be done – invinciblemuffi Jan 26 '16 at 06:31
  • 1
    I think that you mean: if you need to commit on **origin** (your online version). Then you use push. https://help.github.com/articles/pushing-to-a-remote/ – Evin1_ Jan 26 '16 at 06:35
  • As I have understood from your answer above, if we commit on a branch other than master on someone else's repository, than it is called pull request else if we commit in our own repository it is called push. Correct me if I am wrong. Thank you. – invinciblemuffi Jan 26 '16 at 09:26
  • 6
    Not quite, if you want to update any branch of your own code with your changes you use **commit**, if you want to update any branch of someone else's code you use a **pull request**, if you want to update your online repository you use **push**, if you want to update your local repository with the online changes you use **pull**. – Evin1_ Jan 26 '16 at 15:15