Git and GitHub
&
About GitHub
Section titled “About GitHub”GitHub is a cloud-based platform where you can store, share, and collaborate with others to write code. Storing your code in a “repository” on GitHub allows you to:
- Showcase or share your work.
- Track and manage changes to your code over time.
- Let others review your code and make suggestions for improvement.
- Collaborate on a shared project without impacting your collaborators’ work before you’re ready to integrate changes.
Collaborative working, one of GitHub’s fundamental features, is made possible by the open-source software Git, upon which GitHub is built.
About Git
Section titled “About Git”Git is a version control system that intelligently tracks changes in files. Git is particularly useful when you and a group of people are all making changes to the same files simultaneously.
Typically, in a Git-based workflow, you would:
- Create a branch off from the main copy of files that you (and your collaborators) are working on.
- Make edits to the files independently and safely on your own personal branch.
- Let Git intelligently merge your specific changes back into the main copy of files, so your changes don’t interfere with others’ updates.
- Let Git keep track of all changes so everyone stays up-to-date with the latest version of the project.
For more details, see About Git.
How Do Git and GitHub Work Together?
Section titled “How Do Git and GitHub Work Together?”When you upload files to GitHub, you store them in a Git repository. This means that when you make changes (or “commits”) to your files in GitHub, Git will automatically track and manage those changes.
There are plenty of Git-related actions you can complete directly on GitHub in your browser, such as creating a Git repository, branches, and editing files.
However, most people work on their files locally (on their own computer), then sync these local changes—and all related Git data—with the central “remote” repository on GitHub. Tools like GitHub Desktop can help with this.
Once you collaborate with others on the same repository, you’ll continually:
- Pull the latest changes made by your collaborators from the remote repository on GitHub.
- Push your changes back to the same remote repository on GitHub.
Git intelligently handles this flow of changes, while GitHub provides features like pull requests to manage the process.
Where Do I Start?
Section titled “Where Do I Start?”If you’re new to GitHub and unfamiliar with Git, we recommend starting with the articles in the Start Your Journey category. These articles focus on tasks you can complete directly in your browser on GitHub and will help you to:
- Create an account on GitHub.
- Learn the “GitHub Flow” and the key principles of collaborative working (branches, commits, pull requests, merges).
- Personalize your profile to share your interests and skills.
- Explore GitHub to find inspiration for your own projects and connect with others.
- Learn how to download interesting code for your own use.
- Learn how to upload your work to a GitHub repository.
Getting Started with Git
Section titled “Getting Started with Git”- Set Up Git
- Set Your Username
- Caching Credentials
- Git Passwords
- Git Workflows
- About Remote Repositories
- Manage Remote Repositories
- Associate Text Editors
- Handle Line Endings
- Ignoring Files
- Git Cheatsheet