Updated 047 Tutorial on forking JCB snippets so you can share your snippets with the rest of the Community (markdown)

Amigo 2019-08-27 10:45:27 +02:00
parent c269265620
commit cd6cfd858e

@ -9,39 +9,37 @@ Now that a general overview of how things work in the new Snippet Manager has be
[00:00:18](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m18s)
There are two things that should be done. One is to fork the JCB community Snippets on GitHub and to do that you need to have a GitHub account. The second thing is to export the Snippets that you would like to contribute and add it to the Repository that you forked and cloned down to your developing environment and make commit messages on every change that you are intending to make.<<<<<<<
The second thing you would then do although there are few steps in each of these [00:01:03](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m03s) things. The second thing is that you would then make a pull request.
Two things should be done. One is to fork the JCB community Snippets on GitHub and to do that you need to have a GitHub account. The second thing is to export the Snippets that you would like to contribute and add it to the Repository that you forked and cloned down to your developing environment and make commit messages on every change that you are intending to make.[00:01:03](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m03s) The next thing is to make a pull request.
### 1. Improving Existing Snippet 2. Move Existing Snippet To New Type 3. To Add A whole New Snippet Completely
[00:01:10](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m10s)
In this tutorial I'm going to focus on the first few things you need to do and that is just to get you ready. All the things you need to do until the very point when you are now ready to do a pull request. There are three things that I suspect we can do. One is to improve an already existing snippet [00:01:36](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m36s) And then contribute that to the community. The second thing is to move an existing snippet to a new type. This isn't something I hope will happen often, but it can happen that a snippet is in a specific type that is not the best suit for it. You might want to suggest to us changing that. The third one would be to add a whole new snippet completely. I'm just going to demonstrate all three of those [00:02:11](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m11s) and then we'll see how that all plays out until the very point where we are ready to make a pull request.
This tutorial's purpose is to take you, step by step to the point where you will be ready to do a pull request
Three things can be done. One is to improve an already existing snippet and then contribute that to the community. [00:01:36](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m36s) A second option is to move an existing snippet to a new type. Hopefully, that will not happen often, but a snippet may be in a specific type that is not best suited for it. The third one would be to add a whole new snippet completely. I am going to demonstrate all three of those. [00:02:11](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m11s)
### Need To Do Homework And Study Git on Udemy - Use Links
[00:02:19](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m19s)
First we need a repository and we need to understand Git. If you do not know Git this tutorial is not going to cover that you need to do your homework and study up on Git. When you do an export of a package for example if I were to click on these three Grid, Panel and Block and click Share Snippets, you will see that it ends up showing you a bunch of links. One of them is https://www.udemy.com/git-quick-start/. This link, I've searched on Google and found it. I didn't watch it myself I hope it's not bad. If you got a better one please share it on the issue somewhere and we'll improve this link. Or even if you've got your own and you would like us to promote your [00:03:10](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m10s) tutorials on Git, sure why not. We will support those who support our community very gladly. You need to get your head around some of the Git basics so that you can do a [00:03:26](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m26s) fork of the JCB Snippets on GitHub and then make a pull request. This video https://www.youtube.com is the one I'm busy making. It will end up being that link, how to fork the JCB Snippets and all this done. Then after that I'll be making this video(making a pull request https://www.youtube.com. We'll get to that in a moment.
First, we need a repository and need to understand Git. If you do not know Git this tutorial is not going to cover that, you need to study up on Git. When you do an export of a package for example, if I were to click on these three Grid, Panel and Block and click Share Snippets, you will see that it ends up showing you a bunch of links. One of them is https://www.udemy.com/git-quick-start/. I have found this link on Google but did not watch it. If you got a better one please share it on the issue and we will improve this link or if you have your own and you would like us to promote your tutorials on Git, sure why not. [00:03:10](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m10s) You need to get your head around some of the Git basics so that you can do a fork of the JCB Snippets on GitHub and then make a pull request.[00:03:26](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m26s) This video 'https://www.youtube.com' is the one I am currently presenting. It will end up being that link, 'how to fork the JCB Snippets' and all this done, I will make this video ('making a pull request https://www.youtube.com.'<<<<<<<
### Need An Account On GitHub
[00:03:49](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m49s)
You need an account on GitHub. I'm going to use my own account and simply go and fork the repository and use that as demonstration. So needless to say I've got an account I've gone through all those hoops and now I'm simply going to fork 'This repository'. To get to 'This repository' it's this URL https://github.com/vdm-io/Joomla-Component-Builder-Snippets. Another way to get 'This repository' [00:04:16](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m16s) is you go to Get Snippets and then the moment it's finish loading there is a link that you can click which will take you to the GitHub repository and it's this link gitHub. We could click that and as you see we end up at the same place. You could either just follow this URL up here or use that link. But you want to get to Joomla-Component-Builder-Snippets. [00:04:47](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m47s) Since everybody that wants to contribute will need to fork it. I suspect this number here(Fork 1) will change and of course this repository is like 6 days old. I haven't even finished the README. There will be a lot of changes to 'This repository' and it will improve.
You need an account on GitHub. I'm going to use my account and simply go and fork the repository and use that as a demonstration. So needless to say I've got an account I've gone through all those hoops and now I'm simply going to fork 'This repository'. To get to 'This repository' it's this URL https://github.com/vdm-io/Joomla-Component-Builder-Snippets. Another way to get 'This repository' [00:04:16](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m16s) is you go to Get Snippets and then the moment it's finish loading there is a link that you can click which will take you to the GitHub repository and it's this link gitHub. We could click that and as you see we end up at the same place. You could either just follow this URL up here or use that link. But you want to get to Joomla-Component-Builder-Snippets. [00:04:47](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m47s) Since everybody that wants to contribute will need to fork it. I suspect this number here(Fork 1) will change and of course, this repository is like 6 days old. I haven't even finished the README. There will be a lot of changes to 'This repository' and it will improve.
### Forked Repository
[00:05:06](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m06s)
The first thing you do is click on the button Fork and Forked repository. This will then ask you to select where you want to fork it, if you belong to organizations whatever. By then I don't need to explain to you how it works. If for some reason you don't, then you select your personal or whatever organization you want the fork to appear in and then it will copy this repository for you. It's busy doing that. I'm copying it into my personal account.
The first thing you do is click on the button Fork and Forked repository. This will then ask you to select where you want to fork it if you belong to organizations whatever. By then I don't need to explain to you how it works. If for some reason you don't, then you select your personal or whatever organization you want the fork to appear in and then it will copy this repository for you. It's busy doing that. I'm copying it into my account.
### vdm.io/Joomla-Component-Builder-Snippets - The Upstream Or Master Branch - Main Branch
[00:05:43](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m43s)
Good practice: Every time you want to make a change then you need to follow a few steps in having 'This repository' in sync with the what we call upstream repository. This vdm.io/Joomla-Component-Builder-Snippets is what we call the upstream or the master branch or whatever you want to call it, this is the main branch. The one that is being used inside of JCB. Yours isn't directly being used. Whatever changes you make here would not necessarily affect us at all, [00:06:20](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m20s) but you want to commit your changes to your branch and then make a pull request to the upstream branch where you would like to share this with the community. That's sort of a quick explanation. We'll do this slowly. I'm not going to do the pull request in this tutorial [00:06:42](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m42s) but I'll take you all the way up to the wall and then we will get the ladder out and finish that in the next tutorial.
Good practice: Every time you want to make a change then you need to follow a few steps in having 'This repository' in sync with the what we call upstream repository. This vdm.io/Joomla-Component-Builder-Snippets is what we call the upstream or the master branch or whatever you want to call it, this is the main branch. The one that is being used inside of JCB. Yours isn't directly being used. Whatever changes you make here would not necessarily affect us at all, [00:06:20](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m20s) but you want to commit your changes to your branch and then make a pull request to the upstream branch where you would like to share this with the community. That's sort of a quick explanation. We'll do this slowly. I'm not going to do the pull request in this tutorial [00:06:42](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m42s) but I'll take you all the way up to the wall and then we will get the ladder out and finish that in the next tutorial.
### Clone Repository Down To Your Own Developing Environment
@ -143,4 +141,4 @@ I can demonstrate the process of git fetch upstream and it will do that. But sin
[00:34:00](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h34m00s)
That's what you should do before you do the following: git push which will now take these changes you've made and you want to push them to origin master. Everything you've done, all the commits you've made, all the commit messages, the files you removed, all of that now gets pushed up to your cloned version on GitHub. [00:34:36](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h34m36s) If we go to your version on GitHub and we refresh the page, it'll say: This branch is 4 commits ahead of vdm-io:master. Which means you are now ready to make a pull request. A pull request is what we will deal with in the next tutorial. So everything we've done so far in this tutorial is to get the snippets that you've changed, the contributions you want to make into the branch that you forked, [00:35:10](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h35m10s) and to do it in a way that you're not completely out of sync with the master branch which is living on vdm.io/Joomla-Component-Builder-Snippets. This is the master branch that you forked. So you've got those commits in your forked branch and now you want to make a pull request to merge these changes you've made into that master branch [00:35:36](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h35m36s) so that it will eventually become available to the whole community of JCB. If you have any issues please Google, do research. Git is an amazing technology and the quicker you can get your hands on it and become [00:35:59](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h35m59s) comfortable with working with it the better. Next tutorial we'll deal with the pull request.
That's what you should do before you do the following: git push which will now take these changes you've made and you want to push them to origin master. Everything you've done, all the commits you've made, all the commit messages, the files you removed, all of that now gets pushed up to your cloned version on GitHub. [00:34:36](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h34m36s) If we go to your version on GitHub and we refresh the page, it'll say: This branch is 4 commits ahead of vdm-io:master. Which means you are now ready to make a pull request. A pull request is what we will deal with in the next tutorial. So everything we've done so far in this tutorial is to get the snippets that you've changed, the contributions you want to make into the branch that you forked, [00:35:10](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h35m10s) and to do it in a way that you're not completely out of sync with the master branch which is living on vdm.io/Joomla-Component-Builder-Snippets. This is the master branch that you forked. So you've got those commits in your forked branch and now you want to make a pull request to merge these changes you've made into that master branch [00:35:36](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h35m36s) so that it will eventually become available to the whole community of JCB. If you have any issues please Google, do research. Git is an amazing technology and the quicker you can get your hands on it and become [00:35:59](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h35m59s) comfortable with working with it the better. Next tutorial we'll deal with the pull request.