What is GitHub?

Here, we discuss the key GitHub features you use on a daily basis to manage and contribute to software projects.

The GitHub Flow

In addition to providing a platform for collaborative software development, GitHub also offers a prescribed workflow designed to optimize use of its various features. While this unit offers a cursory overview of important platform components, it is recommended that you first review Understanding the GitHub flow .

Issues

Issues are where most of the communication between a project’s consumers and development team occurs. An issue can be created to discuss a broad set of topics, including bug reports, feature requests, documentation clarifications, and more. Once an issue has been created, it can be assigned to owners, labels, projects, and milestones. You can also associate issues with pull requests and other GitHub items to provide future traceability.

A GitHub issuegithub issues

To learn more about GitHub Issues, see Mastering Issues .

Notifications

As a collaborative platform, GitHub offers notifications for virtually every event that takes place within a given workflow. These notifications can be finely tuned to meet your preferences. For example, you can subscribe to all issue creations and edits on a project, or you can just receive notifications for issues in which you are mentioned. You can also decide whether you receive notifications via email, web & mobile, or both. To keep track of all of your notifications across different projects, use the GitHub Notifications dashboard .

GitHub Notifications dashboard

github-notifications

To learn more about GitHub notifications, see Configuring notifications .

Branches

Branches are the preferred way to create changes in the GitHub flow . They provide isolation so that multiple people may simultaneously work on the same code in a controlled way. This model enables stability among critical branches, such as master, while allowing complete freedom for developers to commit any changes they need to meet their goals. Once the code from a branch is ready to become part of the master branch, it may be merged via pull request.

GitHub flow with a feature branch

To learn more about GitHub branches, see About branches .

more about best web hosting reddit

Commits

A commit is a change to one or more files on a branch. Every time a commit is created, it is assigned a unique ID and tracked, along with the time and contributor. This provides a clear audit trail for anyone reviewing the history of a file or linked item, such as an issue or pull request.

GitHub commits to a master branch

To learn more about GitHub commits, see Committing and reviewing changes to your project .

Pull Requests

A pull request is the mechanism used to signal that the commits from one branch are ready to be merged into another branch. During creation, the developer will often request one or more reviewers who are in a position to verify the code and approve the merge. These reviewers have the opportunity to comment on changes, add their own, or use the pull request itself for further discussion. Once the changes have been approved (if approval is required in the project), then the pull request’s source branch (the compare branch) may be merged in to the base branch.

GitHub pull request

To learn more about GitHub pull requests, see About pull requests .

GitHub Pages

GitHub Pages is a hosting engine that’s built right into your GitHub account. By following a few conventions, and enabling the feature, you can build your own static site generated from HTML and markdown code pulled directly from your repository.

 

Custom AI-Assisted IntelliSense for your team

As you’ve been editing code, you may have noticed IntelliCode’s starred recommendations in your autocompletion lists. Our previous IntelliCode blog post explains that these smarter suggestions were machine-learned over thousands of open sourced GitHub repos. Using community knowledge is great for public APIs like the Standard Library, but what if you want IntelliCode recommendations for your APIs and other libraries that wouldn’t commonly be found in open-source code? To address this, in Visual Studio 2019 version 16.5 Preview 3 you can now train custom IntelliCode models on your own codebases. This generates something we call a “Team Completions model, because you’ll start to get recommendations based on your team’s coding patterns.  Continue reading “Custom AI-Assisted IntelliSense for your team”

Learn Swift Ternary Conditional Operator (With Examples)

A standard if/else statement can get pretty lengthy – at least 5 lines of code. Many developers prefer to keep their code as concise as possible and favor a shorter syntax. Swift allows us to minimize our if/else statements with a tool called the ternary conditional operator.

The ternary conditional operator, denoted by a ?, offers a shorter, more concise alternative to a standard if/else statement. It executes one of two expressions depending on the boolean result of the condition.

A ternary conditional consists of three parts in the following format:

A \ ? \ B \ : C
  • A is the condition to check for
  • B is the expression to use if the condition is true
  • C is the expression to use if the condition is false

Suppose we’d like to check if an order was placed successfully by a customer and print them a message. We can set up the following if/else statement:

var orderSuccessfullyPlaced = false

if orderSuccessfullyPlaced {
print("Your order was received.")
} else {
print("Something went wrong.")
}

Since the value of our condition is false, the second code block executes and Something went wrong. will print.

With a sprinkle of ternary magic, we can transform our code into one line, a one liner, and achieve the same result:

orderSuccessfullyPlaced ? 
print("Your order was received.") : 
print("Something went wrong.")

Note that although the ternary conditional operator helps us develop shorter code, overusing this syntax can also result in your code being difficult to read. So, use it sparingly!