Need advice about which tool to choose?Ask the StackShare community!
Git vs GitHub: What are the differences?
Git is a distributed version control system designed for tracking changes in source code. GitHub, on the other hand, is a web-based hosting service that provides a platform for collaboration, version control, and code sharing using Git. Here are the key differences between Git and GitHub:
Version Control System vs Hosting Platform: Git is a distributed version control system (DVCS) that allows you to track changes in your codebase, manage different versions of files, and collaborate with others. On the other hand, GitHub is a web-based hosting platform for Git repositories. It provides a remote repository hosting service where you can store your Git repositories and collaborate with others by sharing code, managing issues, and performing pull requests.
Local vs Remote: Git operates locally on your computer, allowing you to create and manage repositories on your machine. It provides powerful command-line tools and can be used independently without any connection to a remote server. In contrast, GitHub is a remote service that provides a centralized location for hosting and sharing your Git repositories. It allows you to push your local repositories to GitHub, making them accessible to others and enabling collaboration.
Collaboration and Social Features: GitHub enables developers to interact with each other through features like pull requests, code reviews, issue tracking, and project management tools. GitHub also allows for seamless collaboration among team members and facilitates community contributions to open-source projects. While Git itself supports collaboration, GitHub enhances and simplifies the collaboration process with its web-based interface and additional features.
Additional Services: GitHub offers additional services and integrations that go beyond basic version control. It provides features like continuous integration (CI) and continuous deployment (CD) pipelines through GitHub Actions, code scanning for security vulnerabilities, project management tools, and package repositories. These services extend the capabilities of Git repositories and provide a more comprehensive development platform.
In summary, Git is a powerful distributed version control system used for tracking changes in code, while GitHub is a web-based hosting platform that provides additional collaboration and project management features on top of Git. While Git can be used independently, GitHub serves as a centralized hub for hosting repositories, collaborating with others, and accessing a wide range of development tools and services.
To communicate isn’t just getting rid of syntax errors and making code work. The code should communicate ideas to people through a programming language that computers can also understand.
You should adopt semantic variables, classes, modules, and methods names. For instance, in Ruby, we avoid using particular prefixes such as is_paid
, get_name
and set_name
. In their places, we use directly paid?
, name
, and name=
.
My advice is to use idiomatic and features that the programming language you use offers to you whenever possible, and figure out ways to better pass the message.
Why wouldn’t we be worried about semantics, typos, and styles? We should care for the quality of our code, and the many concepts that define it. You can start by using a linter to collect some issues from your codebase automatically.
Do you review your Pull/Merge Request before assigning Reviewers?
If you work in a team opening a Pull Request (or Merge Request) looks appropriate. However, have you ever thought about opening a Pull/Merge Request when working by yourself? Here's a checklist of things you can review in your own:
- Pick the correct target branch
- Make Drafts explicit
- Name things properly
- Ask help for tools
- Remove the noise
- Fetch necessary data
- Understand Mergeability
- Pass the message
- Add screenshots
- Be found in the future
- Comment inline in your changes
Read the blog post for more detailed explanation for each item :D
What else do you review before asking for code review?
Using an inclusive language is crucial for fostering a diverse culture. Git has changed the naming conventions to be more language-inclusive, and so you should change. Our development tools, like GitHub and GitLab, already supports the change.
SourceLevel deals very nicely with repositories that changed the master branch to a more appropriate word. Besides, you can use the grep linter the look for exclusive terms contained in the source code.
As the inclusive language gap may happen in other aspects of our lives, have you already thought about them?
One of the magic tricks git performs is the ability to rewrite log history. You can do it in many ways, but git rebase -i
is the one I most use. With this command, It’s possible to switch commits order, remove a commit, squash two or more commits, or edit, for instance.
It’s particularly useful to run it before opening a pull request. It allows developers to “clean up” the mess and organize commits before submitting to review. If you follow the practice 3 and 4, then the list of commits should look very similar to a task list. It should reveal the rationale you had, telling the story of how you end up with that final code.
Out of most of the VCS solutions out there, we found Gitlab was the most feature complete with a free community edition. Their DevSecops offering is also a very robust solution. Gitlab CI/CD was quite easy to setup and the direct integration with your VCS + CI/CD is also a bonus. Out of the box integration with major cloud providers, alerting through instant messages etc. are all extremely convenient. We push our CI/CD updates to MS Teams.
Gitlab as A LOT of features that GitHub and Azure DevOps are missing. Even if both GH and Azure are backed by Microsoft, GitLab being open source has a faster upgrade rate and the hosted by gitlab.com solution seems more appealing than anything else! Quick win: the UI is way better and the Pipeline is way easier to setup on GitLab!
(1/2) In terms of DevOps we chose GitHub
, Git
, Visual Studio Code
, Sentry
, Yarn
, CircleCI
.
GitHub
was chosen because of its features such as GitHub Projects, GitHub Issues, and GitHub Milestones, which are normally separate tools such as Trello for issue tracking, but come as part a package with GitHub. This choice is also influenced by our decision for using Git for version control.Git
was chosen as our version control because of the wide popularity, familiarity in our team, and rich list of tools that support integrations. A tool such as Perforce does not suit our needs because we do not require the mapping features important to huge code bases and the lack of many popular integrations is not appealing.Visual Studio Code
was chosen as our primary source-code editor for an array of reasons. VS code works well with our chosen version control system since it comes with embedded Git control out of the box. For every language or framework that we are working in, there are multiple extensions to improve our team's productivity and efficiency. It also has live collaboration through their LiveShare feature and more, all while maintaining itself as a lightweight tool.Sentry
,Yarn
, andCircleCI
in part 2.
We will use the ubiquitous combination of Git
for version control and GitHub
for code hosting. They have all the functionality we require for this project and will fit perfectly into our development workflow with up to three developers working simultaneously on the codebase. We also plan on using GitHub Actions
to set up our CI/CD workflows.
VS Code
will be our primary code editor due to its combination of developer-friendly features, including a large extensions library, IntelliSense code completion, Git integration, and powerful debugging tools. Furthermore, it offers better performance and more simplicity than full-fledged IDEs while supporting a multitude of languages.
Selenium
will be used to perform automated testing of our web application. It supports all major web browsers and operating systems and supports test scripts to be written in multiple languages, including Python which we are also planning to use for our back-end, helping us to consolidate the languages required for our project. In addition, Selenium is free and has support for most CI/CD tools.
At DeployPlace we use self-hosted GitLab, we have chosen GitLab as most of us are familiar with it. We are happy with all features GitLab provides, I can’t imagine our life without integrated GitLab CI. Another important feature for us is integrated code review tool, we use it every day, we use merge requests, code reviews, branching. To be honest, most of us have GitHub accounts as well, we like to contribute in open source, and we want to be a part of the tech community, but lack of solutions from GitHub in the area of CI doesn’t let us chose it for our projects.
Pros of Git
- Distributed version control system1.4K
- Efficient branching and merging1.1K
- Fast959
- Open source845
- Better than svn726
- Great command-line application368
- Simple306
- Free291
- Easy to use232
- Does not require server222
- Distributed27
- Small & Fast22
- Feature based workflow18
- Staging Area15
- Most wide-spread VSC13
- Role-based codelines11
- Disposable Experimentation11
- Frictionless Context Switching7
- Data Assurance6
- Efficient5
- Just awesome4
- Github integration3
- Easy branching and merging3
- Compatible2
- Flexible2
- Possible to lose history and commits2
- Rebase supported natively; reflog; access to plumbing1
- Light1
- Team Integration1
- Fast, scalable, distributed revision control system1
- Easy1
- Flexible, easy, Safe, and fast1
- CLI is great, but the GUI tools are awesome1
- It's what you do1
- Phinx0
Pros of GitHub
- Open source friendly1.8K
- Easy source control1.5K
- Nice UI1.3K
- Great for team collaboration1.1K
- Easy setup867
- Issue tracker504
- Great community487
- Remote team collaboration483
- Great way to share449
- Pull request and features planning442
- Just works147
- Integrated in many tools132
- Free Public Repos122
- Github Gists116
- Github pages113
- Easy to find repos83
- Open source62
- Easy to find projects60
- It's free60
- Network effect56
- Extensive API49
- Organizations43
- Branching42
- Developer Profiles34
- Git Powered Wikis32
- Great for collaboration30
- It's fun24
- Clean interface and good integrations23
- Community SDK involvement22
- Learn from others source code20
- Because: Git16
- It integrates directly with Azure14
- Standard in Open Source collab10
- Newsfeed10
- Fast8
- Beautiful user experience8
- It integrates directly with Hipchat8
- Easy to discover new code libraries7
- Smooth integration6
- Integrations6
- Graphs6
- Nice API6
- It's awesome6
- Cloud SCM6
- Quick Onboarding5
- Remarkable uptime5
- CI Integration5
- Reliable5
- Hands down best online Git service available5
- Version Control4
- Unlimited Public Repos at no cost4
- Simple but powerful4
- Loved by developers4
- Free HTML hosting4
- Uses GIT4
- Security options4
- Easy to use and collaborate with others4
- Easy deployment via SSH3
- Ci3
- IAM3
- Nice to use3
- Easy and efficient maintainance of the projects2
- Beautiful2
- Self Hosted2
- Issues tracker2
- Easy source control and everything is backed up2
- Never dethroned2
- All in one development service2
- Good tools support2
- Free HTML hostings2
- IAM integration2
- Very Easy to Use2
- Easy to use2
- Leads the copycats2
- Free private repos2
- Profound1
- Dasf1
Sign up to add or upvote prosMake informed product decisions
Cons of Git
- Hard to learn16
- Inconsistent command line interface11
- Easy to lose uncommitted work9
- Worst documentation ever possibly made8
- Awful merge handling5
- Unexistent preventive security flows3
- Rebase hell3
- Ironically even die-hard supporters screw up badly2
- When --force is disabled, cannot rebase2
- Doesn't scale for big data1
Cons of GitHub
- Owned by micrcosoft55
- Expensive for lone developers that want private repos38
- Relatively slow product/feature release cadence15
- API scoping could be better10
- Only 3 collaborators for private repos9
- Limited featureset for issue management4
- Does not have a graph for showing history like git lens3
- GitHub Packages does not support SNAPSHOT versions2
- No multilingual interface1
- Takes a long time to commit1
- Expensive1