 Hello, good afternoon. Welcome to the talk titled get in 10 minutes alternative title was mission impossible as you've already seen But let's try so I want to start by saying that for me personally the concept of version control is just amazing It is very simple. You make some changes. You store them. You make some more changes. You store them You make some more changes. You store them. It's really that simple But it opens a whole new world of possibilities like for example the WordPress project itself It just couldn't exist without version control tools that enable developers to collaborate on this project another great example is Wikipedia Like if you have a good way to compare revisions and undo stupid stuff You can open this encyclopedia to the entire world and create something very new from what used to be Available in the past so really simple concept very great consequences So let's look an example from WordPress itself This is actually the first time commits ever created for WordPress tracked by subversion So it's been over 14 years ago that guys called Matt and Mike little created these 10 commits It's an actual history. You can still diff what was going on there So here's a changing a link to support forums for example You can see that in subversion all commits are versioned by natural numbers like 1 2 3 4 etc that is because When you work with subversion it uses a centralized model. There is Somewhere on the internet. There is a subversion Repository and when you make some changes when Matt did some change or Mike did some change They send it over the internet to the central server and it maintained the history. It is very different with git You have the entire repository available locally for you. That means that if you today clone The WordPress git repository you will get all 14 years worth of commits available locally So you can inspect the history locally create commits Work offline in a train something like that. So it's a really powerful concept You can see that the server is missing from this light usually in practice You have some sort of central location because it's just easier to coordinate work if you have a Central location but as far as git is concerned. This is just another copy of the repository. They are technically the same So let's quickly go through the core commands. I'll be using this amazing web application I'll share the slides if you're starting with git. I encourage you to visit this website It is really lovely on the left side. Do you have a simplified console? It is not the full commands You need to write but it's pretty close and on the right you see visual representation of what's going on inside And I personally find it very helpful to to have a visual image of what is going on. So Probably the very basic command is just to commit some work You edit some file for example on on on file system and then call git commit to create commits So I've created three of those and it's just three bubbles Ah, you can notice that git doesn't use nice numbers like 1 2 3 4 it is for a good reason This is actually a hash of the change itself So later when git will synchronize the repositories it will know that when it sees two same hashes It's the same change and it doesn't need to transfer the data when it sees a new hash a new number It will need to synchronize. So this is quite important. It is getting some You need to get used to this some people don't like it about git at first but After some time, it's very natural concept. Like why should it be numbered 1 2 3? It's just random numbers, you know So if you view WordPress history on github, you will see these hashes So another powerful concept is branching and merging. This is probably what made git Popular or the other way around git popularized this workflow. It was possible before but it was quite hard Git makes it really simple and mainstream. So whenever you are going to do some work You should create a branch for the task. You can break things there. You can clean up later or whatever so It is like your place to to make work and later when you're happy with the changes you merge them back So so the merging is what git made really simple So it's just git merge Another useful command is git reset which enables you to go to any point of history You can go back like in this case if the merge didn't work You simply reset to previous state. You can also go forward. So whatever was tracked in git You can jump to you can jump to 14 years ago, for example or to yesterday to any state really And the last important concept is synchronizing repositories So in this case, we will have like much repository will be the local one we will be looking at the problem from much point of view and Let's say that the remote repository is Mike's It would in practice probably be something like github, but let's stay with a friendly face So if we compare the hashes like the first commit has the same hash So git has sees no needs to synchronize those those are the same However, the other one has different hash. So it will need to synchronize this So first much tries to push to the remote repository, but it is rejected because there is something incompatible something new on the remote repository. So what what needs to do is to pull first and This will this will bring this single comment from the remote repository is local repository And the second step is combining the local work with whatever came from the remote So it's basically a git pull is fetching commits from remote and merging them with the local work and I think after this you can push and you have basically the same state locally and in the remote repository So everything is synchronized With this I believe you have covered like 80 percent of what you need to know to start with git So you commit to Store the state in a git repository you push and pull to synchronize your work with remote repository Whether it's your colleague or github or bit bucket or git lab or your own server, whatever And then you branch and emerge and this is I believe like 80 percent of what you use in practice This site is amazing. So please try it if you're starting. It's very good introduction So let's spend how how much time do we have? Okay, so let's spend some time talking about git plus WordPress So if you do any sort of plug-in or film development You should definitely be using version control like there is probably no excuse not to do yourself a service Invest like a half a day a day to learn the basics and start using version control It will it will be greatly beneficial for you. But what about the full site? I mean both the files and possibly the database sometimes you need to change options Sometimes you need to create new content in the database Databases are very unfriendly to version control. So really it's complicated You have basically two options today The first one is reviser What revise it does is it supports the database to a dump and it commits the dump to the database So it's sort of like a backup But instead of packing everything into a zip file you commit it to the git repository It is very useful. You can push to github for example to have a remote backup What it cannot really do is branching and merging because the dumps are a huge pile of some data And when you try to merge those two dumps, it will end up you will end up with a lot of conflict So good backup solution, but not really merging solution What we are working on is something called version press Version press watch works by observing every change to a site So if you add a post it will create a commit behind the scenes if you delete the user It will create a commit if you update a plug-in It will create a commit and for every such action you have the undo button So you can see version presses the undo button for WordPress, but it's powered by git behind the scenes It's a true git so you can use all the git clients, you know The other important point about this is it can do actually branching and merging So for example when you do staging Creating staging environment is easy you just copy the website But what it's usually hard you do some changes in staging and the production environment also Receive some new comments or post something like that So you cannot easily replace the production database with the staging one So with version press you can just merge those together. It can do database merging I'll be available at the expert bar after this So or at the real bar in the evening. So if you want to come chat about this a little bit more I'll be available. There's not enough time to do more. So with this a quick summary If you don't use version control really start at least for your plug-in and screams git and github is the simplest start today And if you want to do full WordPress versioning you have two options basically reviser and version press So that's it. Thank you