Github integration — why SashiDo uses GitHub

SashiDo.io
5 min readAug 23, 2016

We saw you enjoyed how easy and straightforward is the setup of Cloud Code in SashiDo. But do you have any idea how cool and helpful this integration with GitHub can actually be? As developers we use GitHub every day, but you probably haven’t thought of all the ways you can take advantage of the possibilities, given by SashiDo and GitHub, working together.

First of all, let me explain why SashiDo chose to integrate its service with GitHub — we do believe that using MBaaS services is very useful, but sometimes you want a little more control over your code — that’s where GitHub comes and gives a hand :) It’s the best web-based Git repository hosting service, which helps you manage better your code.

So let’s get started with the useful part. After you’ve finished the setup of your Cloud Code you can go visit your private repository. You’ll see two folders: “cloud” and “public.”

The first folder keeps the root file, which we import into SashiDo’s cloud. Don’t change the name, if you want to run it. The two other files keep examples of Simple Cloud Code and Advanced Cloud Code.

In the folder “public” you can add your html, css, js files or images, in case you want to host your app website on SashiDo. Also, this is the place for your front-end files, javascript libraries and so on. These are the basics of the main services, provided by SashiDo.

It’s up to you how to use the awesome power, given by GitHub, in order to master your code. If you are new to the Git concept — don’t worry, it’s pretty easy to operate with, especially at a basic level. But nevertheless, our advice is to use the friendly GitHub Desktop.

Take advantage of the branches

Sometimes as the work progresses you come up with different ideas about how to develop something and you are not convinced that the result should be. In no time things can get quite messy and you can easily loose track of the different versions of your project. Integrating SashiDo with GitHub is the answer to that. One of the coolest things in Git concept is that it gives you the opportunity to create multiple branches you can work on — each one is a separate version. Our advice is to work on at least two branches (“master” for the official version and “development” for the work-in-progress). This also resolves your problems if you’re working with other people on the same project — just create your own branch and feel free to experiment and commit changes, safe in the knowledge that your branch will not be merged until it’s ready to be reviewed by someone you’re collaborating with. Each branch can be merged with the “master” when you’re done experimenting and testing.

Regarding the repository, holding your SashiDo’s project — be careful with your “master” branch. When you git push changes to the “master” branch, SashiDo automatically deploys the code to the servers that your app is working on. However, you don’t need any additional tools to manage and deploy your Cloud Code on SashiDo :) Remember every push to the master branch triggers a deploy. So if you are not sure whether you want changes to the “master”or not — just push them to other branch for example. In a while, when you are ready and sure of your code — just merge them with the “master” branch.

Add collaborators

One of the coolest things in SashiDo’s integration with GitHub is that you can invite collaborators — your colleagues or a freelancer — so you can build the project together safely. Your repo is private so only you can choose who to invite. You can make the decision whether to work on the same branch or not. Each time you or your collaborators commit changes in the code — you can decide whether to pull them into your code or to ignore them. Git is smart and in case there’s something suspicious in the versions of the code, the merge won’t happen and the system will show you exactly what is wrong so you can take steps to make it work. In this way you can always keep track if there are conflict changes, so nothing will be screwed up in the final version.

Don’t throw the messed up code — stash it !

Often, when you’ve been working on a part of your project, things are in a messy state and you want to switch branches for a bit to work on something else and you’re not ready yet to commit. It’s not good to push half-done work but you also don’t want to lose what’s already done. There’s very useful command — git stash which solves the problem. It saves your code for the moment you want to continue working on it again.

Just a cool tip — be careful when you stash from different computers — you may have a problem reapplying the work. If the apply tries to change the file that you’ve since modified, you’ll receive a merge conflict and will have to find a way to resolve it. There’s easier option to test the stashed changes again — you can run git stash branch. It will create a new branch, check out the commit you were on when you stashed your work, apply again your work, and if everything is fine — it will drop the stash.

Sometimes a Tag is a savier

Imagine you have a large project and have to make changes to it from time to time, but you have to keep certain versions of it as important. SashiDo understands that well and we suggest you using Git Tag. It has the ability to save and find important phases in history of your work . Developers usually use it to mark specific points as version01, version02 and so on. You can always list those saved versions and go back to each one of them. So if the new updates to your project aren’t working well — take a deep breath and remember that with GitHub everything is reversible :)

Don’t forget the documentation

We know you’re quite busy — it may look so small and time — consuming, but making good documentation to your code is crucial. That’s how if you haven’t worked on your project for a while — it will be much more easier to understand what’s happening. You may also help you team-worker this way. GitHub helps a lot with that — always add well described README.md files. Our suggestion is to go even further and fill in your Wiki — why not create your or your team’s personal Wikipedia with useful and important info.

Integrating GitHub with SashiDo is huge — I hope this gave you at least a glance of what possibilities for controlling your code this gives you. The power to do whatever you want with the flow and the versions of your code is amazing — that’s why we wanted to give that power to you and to have the feeling that you really own and know well your code. So don’t worry anymore about messing up your work — you can always revert a commit :)

--

--

SashiDo.io

API Development, Deployment, and Scaling Made Simple. Build & host globally mobile and web apps with @ParsePlatform, @MongoDB & @NodeJS. www.sashido.io