What's the use of Pull Request? And how to use Bitbucket properly?

I've used BitBucket before but only solo for my own personal projects. I know the basics (the very basic I must say), but for solo developer only. And even then, I did it via Source Tree, not the console. So it's a lot easier for me. My usual workflow is like this: code->commit->code->commit->tag->push(if a feature is done)->code->commit->code->commit->...>tag>push->... Because I'm the only one developing the project, this is fine. But now, I happen to be assigned to create and set a repo in BitBucket for collaboration in the office between me and 2 junior programmers. And honestly, I'm so confused as to how to use BitBucket with other developers besides myself.

So my questions are:

  1. What is the proper way to use BitBucket for collaboration? What do I tell the junior devs to do? What do I (as the creator, owner, and admin of the repo ) have to do? What's the proper workflow that I should get used to?
  2. What's the use of Pull Request? To my understanding, we can "Push" the local copy to the remote repo. And after that, we do a "Pull Request", and the whole team will check it. But what if I, as the admin, denied the push and pull request because it is broken or other reasons? What should I do?
  3. And also in the pull request, there's an option to close branch after the pull request is merged (is it equal to accepting the pull request?). But when I click on it, the branch is still there on my local repo when I accepted the pull request. What is it for then?

Thanks in advance.

PS: Before saying STFW or RTFM, FYI, I have done so these past few months and still confused. And I've actually tried it myself but yeah, as you can see, I'm still very confused.

Upvotes: 3

Views: 791

Answers (1)

Petr Skocik
Petr Skocik

Reputation: 60107

2) A pull request is a message that says "hey, I have some stuff to share, please pull from my repository." That's all there is to it. PR's used to be just e-mail messages. Websites like github and bitbucket made it into a "feature" with a button.

The concept of pull request assumes each of you has their own repo. Your repo on bitbucket might be the central repo of your workflow (voluntarily central, of course). If you have all write access to the central repo, there's no need to ask (make a pull request to) anybody to pull to it, because all of you can push to it on their own.

But it sounds like what you want to do is limit write access to the central bitbucket repo to yourself, allow other to read, and make them file pull request whenever they want to push to the central repo. You'd then review the pull request and either merge them or reject them.

Bitbucket may have some nice UI around it, but this is how it works in principle.

3) If you'd clone from it, the cloned repo shouldn't have the branch anymore and you now don't have to delete the branch on bitbucket, just in your local repo.

Upvotes: 3

Related Questions