publiclab / infragram

A minimal core of the Infragram.org project in JavaScript
https://infragram.org/sandbox/
GNU General Public License v2.0
46 stars 165 forks source link

How to make a successful PR?🤔 #300

Open Somya-Singhal opened 2 years ago

Somya-Singhal commented 2 years ago

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
  2. 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.

  3. 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>

  4. 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.

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

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

  7. 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).

  8. 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)

  9. 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)

  10. 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

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

  12. 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

  13. 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 commented 2 years ago

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

TildaDares commented 2 years ago

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 commented 2 years ago

This is great @Somya-Singhal

Somya-Singhal commented 2 years ago

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 commented 2 years ago

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

Somya-Singhal commented 2 years ago

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

jywarren commented 2 years ago

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 commented 2 years ago

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

rajvidg commented 2 years ago
plots2_Problem3

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

Somya-Singhal commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago
plots2_Problem4

@Somya-Singhal still facing some issues :(

Somya-Singhal commented 2 years ago
plots2_Problem4

@Somya-Singhal still facing some issues :(

type cd \plots2

You will see like this:

image
rajvidg commented 2 years ago

cd \plots2

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

rajvidg commented 2 years ago

cd \plots2

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

Somya-Singhal commented 2 years ago

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.

1)

image

2)

image

3)

image

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

illyShelly commented 2 years ago
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 commented 2 years ago

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 commented 2 years ago
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 commented 2 years ago
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 commented 2 years ago

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 commented 2 years ago

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 cdand hit tab keyand 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 commented 2 years ago

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 cdand hit tab keyand 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!! :)