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

Amigo 2019-08-29 13:03:31 +02:00
parent 8ceedc584d
commit 3e2a16ad1b
1 changed files with 11 additions and 8 deletions

@ -119,19 +119,22 @@ The next commit message I'm just going to say `git commit -m Updated the FooTabl
[00:25:41](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h25m41s)
Now we want to add the accordion which is the new snippet. It is just `git add` and we can select the file name `'Uikit v3 - Collapse) Accordion.json'`. There is a shortcut to this, it is when you use the `.git.add` and that is usually when you have lots of files and just want to add them all. It is like I explained if you are doing a whole bunch of snippets for a specific library. I would suggest doing library per library instead of just mixing them all up. [00:26:10](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m10s) Because if we target a library and add a bunch of snippets for it and then have a commit message just for that, then we could explain that within the commit message, that it is for the specific library and so forth because usually with new libraries it is good for us to take it one step at a time. That file has been added. We just have to add a commit message for it. I'm just going to say `'Added the accordion snippet for Uikit v3 as a demonstration on how this should work.'` [00:26:46](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m46s) Then just again sign off that commit.` git status`.
We have one file left and already have three commits ahead of the branch that we have cloned. [00:27:10](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h27m10s) So just this last file which is the update we have made. We're going to first add the file `git add 'Uikit v2 - (Layout) Form.json'` and then add a commit message to explain what we did.` git commit -m "Added usage paragraph to explain how to use the 'Uikit v2 - (Layout) Form.json'`. Writing out the file name like that is clear enough [00:27:38](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h27m38s) and enter. Again just sign off on that. If you do not have keys, go Google this. Start signing your request. But at this stage, it is not a requirement. If we do `git status` we will see that we are 4 commits ahead.<<<<<<
Now we want to add the Accordion which is the new snippet. It is just `git add` and we can select the file name `'Uikit v3 - Collapse) Accordion.json'`. There is a shortcut to this, it is when you use the `.git.add` and that is usually when you have lots of files and just want to add them all, it is like I explained if you are doing a whole bunch of snippets for a specific library. I would suggest doing library per library instead of just mixing them all up. [00:26:10](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m10s) Because if we target a library and add a bunch of snippets for it and then have a commit message just for that, then we could explain that within the commit message, that it is for the specific library and so forth because usually with new libraries it is good for us to take it one step at a time. That file has been added. We just have to add a commit message for it. I am going to say `'Added the accordion snippet for Uikit v3 as a demonstration on how this should work.'` [00:26:46](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h26m46s) Then just again sign off that commit.` git status`.
We have one file left and already have three commits ahead of the branch that we have cloned. [00:27:10](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h27m10s) So just this last file which is the update we have made. We're going to first add the file `git add 'Uikit v2 - (Layout) Form.json'` and then add a commit message to explain what we did.` git commit -m "Added usage paragraph to explain how to use the 'Uikit v2 - (Layout) Form.json'`. Writing out the file name like that is clear enough and enter. [00:27:38](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h27m38s) Sign off again on that. If you do not have keys, go Google this. Start signing your request. But at this stage, it is not a requirement. If a `git status` is done we will see that we are 4 commits ahead.
### Configuring A Remote For A Fork
[00:28:03](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h28m03s)
This is where we want to do a few more things to your Forked and therefore cloned repository. We want to do something that will keep your repository in sync with the upstream. I'm just going to go and Google this quickly. This is a very helpful document. [00:28:31](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h28m31s) We first need to do this configuring a remote that points to an upstream repository. Let's first look at that one. So this gives you a little explanation of what you should do. First: 'List the current configured remote repository for your fork' branches that you have. [00:28:56](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h28m56s) I've done that and it shows that I've got this git or the origin and it's the fetched and the pushed remote branches. It's going to say: 'Specify a new remote upstream repository that will be synced with the fork'. We'll use the original owner and the original repository name which in our case is the following. The original owner is [00:29:28](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h29m28s) vdm.io and the repository is Joomla-Component-Builder. To get that name, you could come here(Green Clone Button) and you could get the name vdm.io/Joomla-Component-Builder. [00:29:48](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h29m48s) Copy the name. Going back to our tutorial. We will type the git and I suppose you'll have to get the HTTPS version since you will not have permission to work with the SSH version. Let's get the HTTPS one which means that you should click HTTPS here and then grab that version, copy it and [00:30:16](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h30m16s) control shift v will paste it in, into the command line or some command lines even gives you this option to paste with a mouse. Okay so now we got that there and we press enter. Let me try again. [00:30:37](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h30m37s) I didn't add remote add so it was looking for a file. If we did that version we'll see it has this upstream there as well. That was just to add the remote or the upstream repository to the cloned version that you have here.
This is where we want to do a few more things to your Forked and therefore cloned repository. We want to do something that will keep your repository in sync with the upstream. I'm just going to go and Google this quickly. This is a very helpful document. [00:28:31](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h28m31s) We first need to do this configuring a remote that points to an upstream repository. Let's first look at that one. So this gives you a little explanation of what you should do. First: 'List the current configured remote repository for your fork'.(`$ git remote`) [00:28:56](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h28m56s) With that done, it shows this `git` or the `origin` and it's the `fetched` and the `pushed` remote branches. It's going to say: 'Specify a new remote upstream repository that will be synced with the fork'. We'll use the original owner and the original repository name which in our case is the following. The original owner is [00:29:28](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h29m28s) 'vdm.io' and the repository is 'Joomla-Component-Builder'. To get that name, you could come here(Green Clone Button) and you could get the name `vdm.io/Joomla-Component-Builder`. [00:29:48](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h29m48s) Copy the name. Going back to our tutorial. We will type the git and I suppose you will have to get the HTTPS version since you will not have permission to work with the SSH version. Let's get the HTTPS one which means that you should click HTTPS here and then grab that version, copy it and [00:30:16](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h30m16s) _control shift v_ will paste it in, into the command line or some command lines even gives you this option to paste with a mouse. Okay, so now we got that there and press enter. [00:30:37](https://www.youtube.com/watch?v=0hgHeQVTLOk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h30m37s) I didn't add remote add so it was looking for a file. If we did that version we'll see it has this `upstream` there as well. That was just to add the remote or the upstream repository to the cloned version.<<<<<<<<<
### Syncing A Fork (See Video)