What is the use of Git Hub to an app developer.

I hope I can talk about this subject on this Apple's forum.


As I learned more and more about programming and app development, I became aware of a thing called Git Hub. I looked at it and read about it but I am still not sure what good it is to people like us.


I think it is a place where we can post the entire number of files of the code so other app developers can scrutinize the code written.


For example, I know it would be impossible to display all the code of all the classes that go into my current comic book app project. But if I could do just that somewhere else on the web and then post a link here in the Apple forums it would be very handy!


Can someone here enlighten me on this?


JR

Github is a service that allows you to store any form of source code in a repository in your account. While most people use the free service for open source projects, Github has paid accounts that lets you store source code in private repositories only accessible by authorized people. The git program can access any git repositories out there including on Github and with Xcode, you can push and pull source code on Github.


For a single developer, you may not really need it, but with a private account you can store your project source code on Github, access it from anywhere and use it as an offsite backup. Like if you have a desktop machine and a laptop, you can push your code to Github from the desktop, then take your laptop with you somewhere and pull down the source and keep working on it.


Github has other stuff too, like gists, which are one page "repos" for sharing snippets of code. For example, here's one I wrote that shows how to create an Automator action on your Mac that lets you clone a Github project into any Finder folder by copying the repo link and right clicking a folder.


https://gist.github.com/donarb/acb5d75ed94b229cb081


Lastly, Github is a great resource for finding sample code, expecially when you are trying to figure out how a certain API works, just search for that API and you'll likely find some source code that'll explain how to use it.

The huge advantage that source control systems provide is the ability to undo mistakes well after you've discovered you made them.


The advantage that git has over something like svn is that git allows sharing between repositories. So you can setup a local git repository on your machine, check changes into that repository; and then later check the changes in your local repository into a repository on a different machine that you're sharing with other people.


Services like git hub offer a some complementary services:

  • They give you access to set up a git repository on their machines, and let you specify who gets access to the repository
  • They provide a web-based view of the contents of the git repositories that they host


Those services can be really convenient if you're not working for an organization able to provide that to you privately.

Think of it as one more component to the dev community. A 'two-heads' better type of approach to work where there isn't a need to code in a vacuum, and the good karma from sharing.

As a side, it can also help towards learning better coding discipline.

One additional benefit of Github to the ones NotMyName and KMT listed is online backup of your code. Without Github if your Mac was stolen, was destroyed in a fire, or had its hard drive/SSD go bad, you would lose your code. With Github if disaster strikes, you can buy a new Mac, clone your Github code on the new Mac, and continue to work on your app as if nothing happened.

First, I am guessing here, but I suspect you may not be familiar with git. It's a revision control system. It stores every state your code has ever been in. It allows you to go back in time to see code you've removed. But the biggest advantage of git is branching. You can make a branch and try out some code changes to see if they work and if they do, you can merge the code into your main branch.

Then comes GitHub. GitHub is basically a "social coding" platform. Since it's backed by git, all those experimental branches that you can create, others can create as well. They can copy ("fork") your project and make changes. And they can submit those changes to your repository as a "pull request" and you can review them and decide whether to accept ("pull/merge") those changes into your main branch.

To me, that's the biggest advantage. It allows people who have an interest in your project to contribute to its development.

There are tons of other advantages. Continuous integration, code review interfaces, tagging releases, issue tracking, etc. you just have to get used to the idea that it's open source. Anyone could copy your project and diverge (e.g. I forked an RC car controller interface and changed it to control my Bose stereo), so it's important to carefully select the license you want and include it in your repo (e.g. GPL 3.0). It dictates what people are allowed to do with your code.

One other advantage I just thought of... if a developer stops supporting their product and keeping it up to date, any one can jump in and carry the torch by forking the project and maintaining it.

What is the use of Git Hub to an app developer.
 
 
Q