The Basics Of Setting Up GitHub

Scroll for more

The Basics Of Setting Up GitHub

What is Github?

GitHub is a code-hosting platform for version control and collaboration. It allows you and others to collaborate on projects from any location. CaseNine uses Git in its projects to make collaboration not only better but also more enjoyable. A team effort in the end gives not only better results but also a fulfilled feeling. Below in brief how to get started using GitHub.

How do you use Github?

Step 1: create a repository

A repository is usually used to organize a single project. Repositories can contain folders and files, images, videos, spreadsheets, data sets - anything your project needs. We recommend that you include a README or file with information about your project. GitHub makes it easy to add one as you create your new repository.

This is how to create a new repository:

  • Click in the upper right corner next to your avatar and select New repository.
  • Give the repository a name and short description.
  • Select Initialize this repository with a README.

Step 2: create a branch (Branch)

Branching is the way to work on different versions of a repository at the same time.
By default, your repository has one branch named main that is considered the final branch. We use branches to experiment and make edits before committing them to "main."

This is how you create a new branch:

  • Go to your new repository (the one you created in step 1)
  • Click the drop-down list at the top of the file list that says branch: main.
  • Type a branch name, readme operations, in the new branch text box.
  • Select the blue Create branch box or press "Enter"

Step 3: make changes (commits)

So now you can really get started! On GitHub, saved changes are called commits. Each commit has an associated message, which is a description that explains why a particular change was made. Commit messages record the history of changes so that other users understand what you did and why.

Making and recording changes

  • Click on the README.md file.
  • Click the pencil icon in the upper right corner of the file view to edit.
  • In the editor, write something about yourself.
  • Write a commitment message describing your changes.
  • Click the Commit Changes button.

Step 4: open a pull request

Now that you have changes to a branch off of master, you can open a pull request.

Pull-requests are the core of collaboration on GitHub. When you open a pull request, you introduce your changes and ask someone to review and pull in your contribution and merge it into their branch. Pull requests show differences, or divergences, from the content of both branches. Changes, additions and subtractions are displayed in green and red.

Once you make a commit, you can open a pull request and start a discussion even before the code is ready.

Step 5: Code review

An important step is to conduct a code review. During a code review, you check each other's code and check for any errors. It also allows you to ensure quality and that the look and feel of your project remains the same throughout.

Step 6: Merge your Pull Request

In this final step, it's time to merge your changes - merging your readme-edits branch into the main branch.

  • Click the green Merge pull request button to merge the changes into main.
  • Click Confirm Merge.
  • Go ahead and delete the branch, as the changes are recorded, using the Delete branch button in the purple box.

This is what you can do now and have accomplished with these steps:

  • Created an open source repository
  • A new industry started and managed
  • Modified a file and made those changes in GitHub
  • A Pull Request opened and merged

Good luck with setting up your Github environment!

Interested in what we can do for you?

Contact our experts directly. We'd love to hear from you!

Curious for more? Subscribe to the Technical Deep Dive series today.

Colin Hammer

Colin Hamer is a Software Engineer at CaseNine. He is responsible for various Salesforce projects at clients.

Receive notification when a new blog arrives

We would love to keep you updated on the latest news.