Sitemap

Code ladder climber quick ( Github and Git )overview

Open source is the new sauce – Big Obinna, ( mans not hot)

--

Listen to yoda

For years developers have had to share files and code using USB’s, this introduces a lot of bugs and Conflict and only Devs that were in close proximity to each other could work together… Until 10 years ago the developer gods sent us GitHub!!!!

Most people often confuse Git and GitHub

Press enter or click to view image in full size
and some other funny people argue that they are the same thing.

For the record GitHub is a hosting service for Git repositories. So they are not the same thing: Git the tool for version control , GitHub the service for projects that uses Git.

Github and collaboration…

At Genesys tech hub where I intern,we believe in collaboration, and we also use GitHub for this.( Nobody wants to be moving around with a USB to copy code, it’s 2018) ….

Like I said it’s 2018 and open source projects are getting a lot of heat, most individuals want to collaborate on Git hub. Now the question is how exactly do we collaborate? How do we maintain order?, and make sure we keep building cool stuff ???

The Git Workflow …

You might have seen a bunch of tutorials on how Git works and steps to commit to a repo, but the hidden feature of using this version control tool don’t lie in shell commands

It begins before the coding and the process of algorithmic thinking.

It starts with a plan

Using GitHub to collaborate can be tricky without plan …

So first of all. The process is

  • Plan
  • Delegate roles
  • Decide on naming conventions ( Tabs / 4 spacing )
  • Get to coding and branching and committing

The idea behind the above steps is to increase effectiveness and for uniformity

Mostly when people decide to create projects, they usually want to be able to update versions of this project. Some other people might just want to add their own ideas to projects and see how it goes from there…

This can be done by using Git pull requests…

Git Pull request

Press enter or click to view image in full size

When Developer A, pushes his code to a repo on GitHub, The only way developer B can access and make his own contribution to this project is by sending a pull request, after modification…

Get Obinna Ekwuno’s stories in your inbox

Join Medium for free to get updates from this writer.

The process is simple,

  1. Fork the target repo to your own account.
  2. Clone the repo to your local machine.
  3. Check out a new. branch and make changes ( write a new version if you like)
  4. Push your topic branch to your fork.
  5. Use the diff viewer on GitHub to create a pull request via a discussion.
  6. Make any requested changes.
  7. The pull request, that would have to be considered you the original author of the code before and if it would be added to the master.

See a pull request as asking an author to add your code to his original version like ??

Branching

In my opinion the whole point of version Control was the power of branching, With this a developer can just create a product and keep updating the version of what he already has without losing the original version he started from. Branches are usually like branches of a tree ( Master), And at any time, moving back to the original or any point is done by a process called merging

Merge conflicts

Most times in the course of contributing to open source, the version you’re working with might have already been updated. Then when you want to commit back you’d have a problem because the branch you cloned from has been upgraded and merging becomes a problem …

You might feel like this

But is it really a problem?

Merging conflicts can be solved by

  • comparing the already updated version to to what you have on your local repo…
  • Discussion which then leads to
  • Resolution
  • Now we push

In the course of pushing you’d obviously need to add a commit message and this also has good practices

Commit messages

Good commit messages are characterized by the following

  • Precision – Don’t be too chatty, get straight to the point
  • Description – Still give the developer a good idea of what he’s about to clone
  • Sarcasm is allowed… ( sometimes ) ( NB just sometimes)

Best Practices in collaboration

  • Plan First !!!!!
  • Always make logical changes… One functional unit at a time
  • Commit messages should be descriptive
Press enter or click to view image in full size
Safe!!!!

Live long and prosper 🖖🏿 – Spoke

--

--

Written by Obinna Ekwuno

Writer of all things Technical and inspirational , Developer & Community Advocate. In a love-love relationship with JavaScript🔥.