From 328bb14281077233817496862b4694efd6eb37b5 Mon Sep 17 00:00:00 2001 From: MadhavChoudhary Date: Wed, 30 May 2018 07:51:02 +0530 Subject: [PATCH 1/3] Added Commands for steps --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3548a30..57be230 100644 --- a/README.md +++ b/README.md @@ -8,20 +8,49 @@ Look for a project's contribution instructions. If there are any, follow them. - Create a personal fork of the project on Github. - Clone the fork on your local machine. Your remote repo on Github is called `origin`. -- Add the original repository as a remote called `upstream`. +``` +git clone < your_forked_repo > +git remote -v +``` +- Add the original repository as a remote called `upstream`. Select branch_in_original_repo as `develop` if it exists, else go for `master`. +``` +git remote add upstream < original_repo_from_which_you_forked / branch_in_original_repo > +``` - If you created your fork a while ago be sure to pull upstream changes into your local repository. +``` +git pull upstream +``` - Create a new branch to work on! Branch from `develop` if it exists, else from `master`. +``` +git checkout < branch_in_original_repo > +git checkout -b < your_new_branch > +``` - Implement/fix your feature, comment your code. +``` +git status +git add . +git commit -m 'your_commit' or git commit -S -m 'your_commit' for signed commit +``` - Follow the code style of the project, including indentation. - If the project has tests run them! - Write or adapt tests as needed. - Add or change the documentation as needed. - Squash your commits into a single commit with git's [interactive rebase](https://help.github.com/articles/interactive-rebase). Create a new branch if necessary. - Push your branch to your fork on Github, the remote `origin`. +``` +git push -u origin < your_new_branch > +``` - From your fork open a pull request in the correct branch. Target the project's `develop` branch if there is one, else go for `master`! +``` +In Github page of original repo. +``` - … - If the maintainer requests further changes just push them to your branch. The PR will be updated automatically. - Once the pull request is approved and merged you can pull the changes from `upstream` to your local repo and delete your extra branch(es). +``` +git branch -d < your_new_branch > if merged +git branch -D < your_new_branch > force delete +``` And last but not least: Always write your commit messages in the present tense. Your commit message should describe what the commit, when applied, does to the code – not what you did to the code. From b46cb146e14f148b1a5c05245954f36e906ee3ff Mon Sep 17 00:00:00 2001 From: MadhavChoudhary Date: Wed, 30 May 2018 07:56:08 +0530 Subject: [PATCH 2/3] Changed a commmand to set the upstream of new_branch to origin --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 57be230..394070b 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,11 @@ git commit -m 'your_commit' or git commit -S -m 'your_commit' for signed commit - Squash your commits into a single commit with git's [interactive rebase](https://help.github.com/articles/interactive-rebase). Create a new branch if necessary. - Push your branch to your fork on Github, the remote `origin`. ``` -git push -u origin < your_new_branch > +git push --set-upstream origin < your_new_branch > ``` - From your fork open a pull request in the correct branch. Target the project's `develop` branch if there is one, else go for `master`! ``` -In Github page of original repo. +In Github page of your repo, you will have this option. ``` - … - If the maintainer requests further changes just push them to your branch. The PR will be updated automatically. From da1d85ef9da7c88aa26fe1b450e6e7927cf30d05 Mon Sep 17 00:00:00 2001 From: MadhavChoudhary Date: Wed, 30 May 2018 22:37:54 +0530 Subject: [PATCH 3/3] Small Change --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 394070b..46f7177 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ git checkout -b < your_new_branch > ``` git status git add . -git commit -m 'your_commit' or git commit -S -m 'your_commit' for signed commit +``` +``git commit -m 'your_commit'`` or ``git commit -S -m 'your_commit'`` for signed commit ``` - Follow the code style of the project, including indentation. - If the project has tests run them!