You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

Fork the ASF repo

$ git clone https://git-wip-us.apache.org/repos/asf/incubator-quickstep.git quickstep

$ cd quickstep

Work on a new feature

// Create a JIRA ticket at https://issues.apache.org/jira/browse/QUICKSTEP, say QUICKSTEP-101.

$ git checkout master

$ git checkout -b my-awesome-feature

$ git add some-changed-or-new-files

$ git commit -m "QUICKSTEP-101: Added My Awesome Feature."

$ git push origin my-awesome-feature

 

// Sometime we may have code review comments after opening a PR.

$ git add more-changed-or-new-files

$ git commit -m "Addressed Review Comments."

 

// Finally, once the PR are ready to merge (i.e., passing all the CI tests),

// we have to squash all the commits into one. We cherry pick the first commit,

// and squash all the rest.

$ git rebase -i origin/master

// In the editor, we would see

//   QUICKSTEP-101: pick Added My Awesome Feature.

//   pick Addressed Review Comments.

// And we need to modify all the content (except to the first line) to "s Addressed Review Comments.".

 

// Check "Author" field in the last commit with the intended name and email. Amend them if needed.

$ git log

 

$ git push origin my-awesome-feature -f

Create a PR for the new feature

Use the GitHub ASF mirror repo: https://github.com/apache/incubator-quickstep, and set the title with the JIRA ticket.

In this case, QUICKSTEP-101: Added My Awesome Feature.

Merge a PR

// Update the local fork with the new branch my-awesome-feature.
$ git fetch origin
$ git checkout master

// We should ensure this is one commit w/ a well-written commit message.
$ git rebase -i origin/my-awesome-feature
// If we see "noop", we are good to merge. Otherwise,
// the committer should notify the PR submitter
// to rebase the branch to become a single commit ahead the current master branch.

$ git log
// If we see a commit message like
// we should abort the merge; otherwise we will mess up the master history.

 

// It triggers asfgit to merge the PR in GitHub ASF mirror repo.
$ git push origin master

// It triggers asfgit to delete the merged branch.
$ git push origin --delete my-awesome-feature
// Close the JIRA ticket regarding this PR.

NOTE

Always use "git rebase". Never use "git pull" or "git merge" as that changes the master history and will produce unrelated commit messages for future PRs. 
  • No labels