airavata-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shameera Rathnayaka <shameerai...@gmail.com>
Subject Re: Creating different PRs for different tasks
Date Fri, 30 Sep 2016 21:14:32 GMT
Hi Gourav,

Nice! This is very useful details, should go to Airavata documentation for
future reference.

Regards,
Shameera.


On Fri, Sep 30, 2016 at 4:37 PM Shenoy, Gourav Ganesh <goshenoy@indiana.edu>
wrote:

> Hi dev,
>
>
>
> I recently faced a trivial problem due to my lack of understanding on how
> we create different PRs for different tasks – my code for different tasks
> were getting added to the same PR because I was using a single branch to
> commit my code & creating PRs from that branch.
>
>
>
> *Problem:*
>
> Eg: I forked the *airavata* repository and cloned the *develop* branch. I
> worked on 2 tasks A, B. I pushed changes for A to my forked develop branch,
> and created a PR #1. When I pushed changes for B to my forked develop and
> tried creating a new PR, it added the new code to PR #1 (instead of
> creating PR #2).
>
>
>
> *Solution (There might be other/better ways to do this):*
>
> Let me explain in a step by step manner.
>
>
>
> 1.       Fork the “apache/airavata” repository to my personal profile.
> This will now be “gouravshenoy/airavata” repository.
>
>
>
> 2.       Since I will be working on the “develop” branch, I cloned the
> develop branch from this forked repository.
>
> $ git clone –b develop git@github.com:gouravshenoy/airavata.git
>
>
>
> 3.       I now create a new branch from my forked develop branch to work
> on Task A. Say I name this branch “task-A”.
>
> $ git checkout –b task-A develop
>
>
>
> This will automatically switch to the new branch “task-A” for me to work
> on and commit my changes.
>
>
>
> 4.        I make my changes and commit my code. I then push my code to
> this new branch.
>
> $ git commit –m "changes for task-A"         # commit changes
>
> $ git push --set-upstream origin task-A      # push changes to new branch
>
>
>
> 5.       Create a PR #1 for this task by comparing base “apache/airavata
> : develop” with head “gouravshenoy/airavata : task-A”.
>
>
>
> 6.  Similarly for Task B, I can create a new branch from “develop” and
> commit my changes to it.
> $ git checkout –b task-B develop
>
> $ git commit –m "changes for task-B"         # commit changes
>
> $ git push --set-upstream origin task-B      # push changes to new branch
>
>
>
>
>
> 7.       I can then create a new PR #2 for this task by comparing base
> “apache/airavata : develop” with head “gouravshenoy/airavata : task-B”.
>
>
>
> 8.       Once the PR has been reviewed and the code merged, you can
> safely delete these new branches.
> $ git push origin :task-A
> $ git push origin :task-B
>
>
>
> Again there might be other effective ways to do this, but this worked well
> for me and helped me understand better how we can create new PRs without
> adding everything to one. Hope this helps!
>
>
>
> *Note: Also while pushing commits, it is recommended to add the JIRA issue
> number to the commit so that Git automatically links the JIRA issue with
> the commit/merge.*
>
>
>
> Thanks and Regards,
>
> Gourav Shenoy
>
-- 
Shameera Rathnayaka

Mime
View raw message