yeeter 528 Posted November 22, 2019 What is git? Git is a version control system for files. It can be used for an array of things but is most commonly used with programming. Some media companies use git as a way to revise, edit, and archive written articles before publishing them. Git allows for easy version control, feature management, and collaboration with other developers. Where to get git? You can download git from here -> https://git-scm.com/ download and install it for your desired operating system. If you are running linux sometimes it is preinstalled so I would check that. Getting Started Once installed open up a command line (I am using Git Bash) and type the command below to check that git was installed correclty. git --version Requesting an SDN Git Repo This part only applies if you are looking to publish scripts on the SDN. All of these commands will work with other services such as Github and GitLab. I personally use Github for personal projects and my private scripts. So now that we have git up and running in our development environment we need a way to store our SDN scripts so that they can be published. Head over to the Dreambot’s SDN page and you can find the request form under Scripter Panel -> Git Repo Request (or click this link) .https://sdn.dreambot.org/scripters/repo This page is where you request your git repository for the SDN. This process can take a couple of days so request it sooner rather than later. You can check the status of this by looking at Scripter Panel -> Requests and it should list the status of your repo there. Once it is created you will be sent a URL, and a password for the repository. Don’t lose them. Setting up the repository Navigate to where you want to place the repository Dreambot has provided you. In my case I have a folder on my desktop called mySDNScripts. Since this is an existing repository we will want to do what is called a “clone”. Which simply copies an existing git repository to another location. We will need that URL and password provided to us in the SDN request. The command will look like this. git clone [email protected]:yourOwnUsername.git Smash that enter key and it may ask a question about authenticity just type “yes”. You will then be prompted for the password you were assigned. Copy paste that into the password field. *Side note - Iif you don’t have a ton of linux experience password fields in linux will not show an * or dot while filling them out. It will be invisible. Just hit enter after you type/copy it.* And BOOM! We have cloned our repository from the Dreambot git server to our computer! Adding a script to your repository. Opening the repository (in my case Yeeter01) this is where you will create your scripts. Each script will be its own subfolder in Yeeter01. So in my case the only two scripts I have actively publish on the SDN at the moment are my AccountYEETER and YEETPicker AIO. These subfolders are referred to as “Modules”. *Side note - These modules do not have to match the name of the published script ex.) aiopicker is YEETPicker AIO. It is probably best practice to make those match tho.* *Second side note - Make sure your module names have no spaces or special characters.* So I wrote an example script called “YEETGitTut” that I would like published to the SDN. I create a folder (module) in my repository Yeeter01 called YEETGitTut. Inside this folder is my src folder. This is where my code will be stored. This script is a simple script consisting of one file in YEETGitTut/src called MyLeetScript.java. For larger scripts all your packages, resources would also be listed under your src/ folder. These changes however are not yet saved. Going back up to the root of your git directory (Yeeter01) and checking the status will return a list of created, deleted, and modified files or folders. git status So you can see everything under YEETGitTut/ needs “staged” or in other words selected to be added to the next commit. This is done in order to allow users to select the files they want to commit. If you are working on multiple scripts at once this prevents you from tying multiple scripts to a single commit. Super handy incase one of them breaks in the future and you need to rollback the changes. git add --all We have added the files to the staging area for our next commit so we must now commit these files. To our local git repository with a message we can refer to in the future using the -m param. git commit -m "Inital commit for YEETGitTut" After committing you can recheck the status of the repository and you will notice that we are 1 commit ahead of the git repository Dreambot host on their servers also referred to as the “Origin”. This means we need to provide them with the changes we made on our “master” by pushing the code back to them. git push origin master Checking git status afterwards we can see that both copies of our git repository are up to date! The hard part is now over! Publishing your script! So we wrote the script, committed and pushed the script the Dreambot’s git repository what's left?!?!?! Well now you need to make a forum post for the script you are wanting to publish. This is the place you should go into detail about what your script does, any features it has etc etc. Publish this forum thread under the sub section of the forum called “SDN Scripts” and find the section that your script falls under. Once completed hit publish. It will be hidden until approved. Now go to Dreambot’s SDN page -> Scripter Panel -> New Script (or click the link) https://sdn.dreambot.org/scripters/scripts/new This is the form for publishing your script. Script Form Name and Category - This should just match what you put in your ScriptManifest. Gallery - Lets users see a preview of your script. I just reuse the images I put in my forum thread for this. ThreadUrl - Copy paste the URL of the forum thread you just made and pate it here. This allows users to view the additional information and features of your script you wrote in the thread. Type - Unless you are ranked Scripter+ or above you can ONLY PUBLISH FREE SCRIPTS. Read more about the ranks and how to obtain them here -> https://dreambot.org/forums/index.php?/topic/4892-list-of-forum-ranks/ Repository Name - This is the name you requested it to be called. When you clone your repository it is that root folder we worked in. In my case Yeeter01. Module Name - This is the script you want to publish. In my examples case we created a script called “YEETGitTut” put that name exactly in that folder. Just like that we are DONE! SMASH that submit button! At this point you can check the progress of your script being published in the Scripter Panel -> Request area. This process can take a couple of days due to code review. While this might sound complicated once its set up the work flow is basically boiled down to -> Edit Script -> "git add" all the files you want to commit -> "git commit -m" all the files you added -> "git push origin master" to send your code to the Dreambot git server(origin). The biggest pro of git in my personal book is it allows me to transfer code from computer to computer with ease. Traveling for work and using multiple computers this can be a pain but with git and services such as Github/GitLab as well as Dreambot's SDN I can work on projects/code form anywhere on any machine I can install git on. More resources~ This was long winded and I really glanced over a lot of the capabilities of git. If you would like more in depth knowledge I HIGHLY suggest watching this crash course. It covers the fundamentals and breaks down things really well and gets into some cool git usages. Git Crash Course - YouTube video (30ish mins reallllllly good) https://www.youtube.com/watch?v=SWYqp7iY_Tc SDN Upload Guidelines Guide by apec using SmartGit GUI Git is a highly used tool if you need assistance or have any errors be sure to just google it first. Chances are 1000000000 other people have ran into the same error you are having. If you need any direct assistance feel free to hit me up on Discord (username can be found on my profile) or on the forum. * I wrote this in one go if I screwed anything up lmk will edit to correct it. *
NovaGTX 106 Posted November 22, 2019 Solid write-up bud. This should help some new folks who are in need to setup git.
yeeter 528 Author Posted November 22, 2019 Just now, NovaGTX said: Solid write-up bud. This should help some new folks who are in need to setup git. thnx my dude
yeeter 528 Author Posted November 22, 2019 11 minutes ago, lily said: This is fantastic, great work Thanks!
Hashtag 8900 Posted November 22, 2019 Awesome guide! It's worth mentioning that the module name must not contain spaces.
Nuclear Nezz 2062 Posted November 22, 2019 1 hour ago, Hashtag said: Awesome guide! It's worth mentioning that the module name must not contain spaces. Or special characters, generally (unsure if this was mentioned or not tbh)
yeeter 528 Author Posted November 23, 2019 5 hours ago, Hashtag said: Awesome guide! It's worth mentioning that the module name must not contain spaces. 3 hours ago, Nuclear Nezz said: Or special characters, generally (unsure if this was mentioned or not tbh) Well edit and add those two points, thanks guys
Pixel_Life 24 Posted October 22, 2020 Small grave dig but I wanted to say thanks, this really helped me out. I also watched the YouTube video you recommended.
420x69x420 72 Posted September 29, 2022 Another grave dig but shout out to Yeeter for this great guide (and the link to the youtube vid which explains git in more detail)!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.