Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make a successful PR?🤔 #300

Open
Somya-Singhal opened this issue Mar 31, 2022 · 23 comments
Open

How to make a successful PR?🤔 #300

Somya-Singhal opened this issue Mar 31, 2022 · 23 comments
Labels

Comments

@Somya-Singhal
Copy link
Contributor

Somya-Singhal commented Mar 31, 2022

To help beginners who have started their journey to open source, I am writing few steps to create a successful PR.

  1. Click on the fork icon present at the top right corner of the repository.
    Here is the link of the repository (https://github.com/publiclab/infragram)

    This step will create a copy of the main repository so that you can modify it.

pl-4

  1. Now you have to clone the repository.
    For this first copy the URL by clicking as shown in the below demo image.

pl-5

Then after creating a folder in your desktop, open bash shell and type the command(but remember to replace "url" in the
below command with the url that you have copied above)
git clone <url>

This step creates a copy of the repository in your own computer.

  1. Now you have to create a new branch(as the whole code workflow is in main branch so whenever any issue needs to be
    solved it is necessary that we make changes on a separate branch so that it does not disturbs the whole workflow and
    later it can be reviewed and merged)
    Command for creating a new branch(remember to replace "name-of-the-branch" with the name you like to give for the
    branch)
    git checkout -b <name-of-the-branch>

  2. Open the file where you want to make changes and make all necessary changes that's required to fix the issue you are
    working on and save it.

  3. (Optional step)-> You can do git status to check the files you have modified.

  4. (Optional step)-> You can also do git diff to see the lines which you have deleted or modified.

  5. Now to add the files you have modified, do git add <name-of-the-modified-file> (Remember to replace "name-of-the-
    modified-file" with the name of the file(s) you have modified).

  6. Now to commit the changes, do git commit -m "<write-a-message-here>" (Remember to replace "write-a-message-
    here" with the message fitting according to the issue you are fixing)

  7. Now do, git push --set-upstream origin <name-of-the-branch> (Remember to replace "name-of-the-branch" with the
    name that you have given to the branch in step-3)

  8. Now we have to configure a remote for the fork, then sync the fork(this step is done to keep your local copy of the
    codebase up to date)
    To configure a remote for the fork, write the following commands:

    • git remote -v
    • git remote add upstream https://github.com/original-owner-username/original-repository.git
      [For this project this command will be: git remote add upstream https://github.com/publiclab/infragram.git]
    • To see the upstream repository was properly added, write the following command git remote -v

    To sync the fork, write the following command: git fetch upstream

  9. Now we have to switch to local main branch of the repository, for this, write command: git checkout main

  10. To merge any changes that were made in the original repository’s main branch with our local main branch, write command git merge upstream/main

  11. Now you can go to your github and see there git will automatically show "your recent pushed branches", there click on "Compare & pull request" and you can add the message you want so that it will give insight about issue that you had fixed and finally click on create a pull request.

Done!!✌

@Somya-Singhal
Copy link
Contributor Author

Hi @TildaDares , I created an issue to help beginners to make a PR. Can you suggest changes if any needed?

@TildaDares
Copy link
Member

Hi @Somya-Singhal, this looks really great. I think you missed the step of setting a remote for the fork. This article explains more https://www.digitalocean.com/community/tutorials/how-to-create-a-pull-request-on-github

@on2onyekachi
Copy link
Contributor

This is great @Somya-Singhal

@Somya-Singhal
Copy link
Contributor Author

Thanks @TildaDares @on2onyekachi for encouraging me. I have updated the issue @TildaDares. Can you please review it and suggest further changes if it's needed?

@TildaDares
Copy link
Member

Amazing work @Somya-Singhal!! You can share this in the chatroom so that other applicants know about it. Thanks!

@Somya-Singhal
Copy link
Contributor Author

Thanks @TildaDares for giving me an opportunity to help others, I will share this in the chatroom.

@jywarren
Copy link
Member

jywarren commented Apr 5, 2022

Hi @Somya-Singhal i love this! Perhaps you'd like to add a link to this from the README? That itself could be a first-timers-only issue if you'd like to create it?

@Somya-Singhal
Copy link
Contributor Author

Ya sure @jywarren, I will create an FTO issue and update you!

@rajvidg
Copy link

rajvidg commented Apr 13, 2022

plots2_Problem3

@Somya-Singhal , I am facing this issue in step 3, can you please help me.

@Somya-Singhal
Copy link
Contributor Author

Somya-Singhal commented Apr 13, 2022

Sorry for the delayed response, you have to first do cd \plots2 and then do step-3. Hope it helps! If you need any help you can ask here.😊

@rajvidg
Copy link

rajvidg commented Apr 13, 2022

Sorry for the delayed response, you have to first do cd \plot2 and then do step-3. Hope it helps! If you need any help you can ask here.😊

Ok thank you I'll look into it.:)

@rajvidg
Copy link

rajvidg commented Apr 13, 2022

plots2_Problem4

@Somya-Singhal still facing some issues :(

@Somya-Singhal
Copy link
Contributor Author

Somya-Singhal commented Apr 13, 2022

plots2_Problem4

@Somya-Singhal still facing some issues :(

type cd \plots2

You will see like this:
image

@rajvidg
Copy link

rajvidg commented Apr 13, 2022

cd \plots2

Thank you for your help, but it's still showing the same error. :'(

1 similar comment
@rajvidg
Copy link

rajvidg commented Apr 13, 2022

cd \plots2

Thank you for your help, but it's still showing the same error. :'(

@Somya-Singhal
Copy link
Contributor Author

Can you show your folder structure once via screenshots if possible? Because you can directly right click in that directory and open the terminal also. May be this could help.

image

image

image

Here you can continue from step-3 for making a new branch.

@illyShelly
Copy link

plots2_Problem4

@Somya-Singhal still facing some issues :(

Hi @rajvidg , you can use command in your terminal ls to list all folders and files. So, there you should see your plot2 folder. If not, you have located the repo somewhere else. Good luck.

@rajvidg
Copy link

rajvidg commented Apr 14, 2022

Can you show your folder structure once via screenshots if possible? Because you can directly right click in that directory and open the terminal also. May be this could help.

image image image

Here you can continue from step-3 for making a new branch.

plots2_Problem5

Ok thank you, I'll try that

@rajvidg
Copy link

rajvidg commented Apr 14, 2022

plots2_Problem4 @Somya-Singhal still facing some issues :(

Hi @rajvidg , you can use command in your terminal ls to list all folders and files. So, there you should see your plot2 folder. If not, you have located the repo somewhere else. Good luck.

okay thank you!

@rajvidg
Copy link

rajvidg commented Apr 14, 2022

plots2_Problem4 @Somya-Singhal still facing some issues :(

Hi @rajvidg , you can use command in your terminal ls to list all folders and files. So, there you should see your plot2 folder. If not, you have located the repo somewhere else. Good luck.

plots2_Problem6

So should I use this path or what? Can you please help? :(

@Somya-Singhal
Copy link
Contributor Author

Somya-Singhal commented Apr 14, 2022

Once can you try writing this command cd plots2/
Please make sure you are not giving any space before writing the above command

image

@illyShelly
Copy link

illyShelly commented Apr 14, 2022

Hi @rajvidg , as @Somya-Singhal mentioned above. Write just cd plots2 and hit enter. I can see you have written there
backslash \ (cd \plots2). That's wrong.
Or just I hope it works in Windows as well.

Write cd and hit tab key and it offers you folder/s inside of this cloned_1 . Use tab key again to jump on your desired folder and then hit enter. Good luck 🤞

@rajvidg
Copy link

rajvidg commented Apr 15, 2022

Hi @rajvidg , as @Somya-Singhal mentioned above. Write just cd plots2 and hit enter. I can see you have written there backslash \ (cd \plots2). That's wrong. Or just I hope it works in Windows as well.

Write cd and hit tab key and it offers you folder/s inside of this cloned_1 . Use tab key again to jump on your desired folder and then hit enter. Good luck 🤞

Oh, okay thank you!! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants