Git basics - GitHub Docs
https://docs.github.com/en/get-started/git-basics • 155 KB fetched Open original page
Git basics - GitHub Docs Skip to main content
GitHub Docs Version: Free, Pro, & Team
Search or ask Copilot Search or ask Copilot
Select language: current language is English
Search or ask Copilot Search or ask Copilot
Open menu
Collapse sidebar Expand sidebar
Scroll breadcrumbs left
* Home
* Get started
* Git basics
Scroll breadcrumbs right
Get started
*
*
* Start your journey
* What is GitHub?
* Learning resources
* Create your repository
* Plan your work
* Connect locally
* Write and store code
* Review changes
* Deploy automatically
* Onboarding
* Getting started with your GitHub account
* Getting started with GitHub Team
* Getting started with the GitHub Enterprise Cloud trial
* Getting started with GitHub Enterprise Cloud
* Using GitHub
* Hello World
* GitHub flow
* Connecting to GitHub
* Communicating on GitHub
* Feature preview
* Supported browsers
* GitHub Mobile
* Allow network access
* Connectivity problems
* Learning about GitHub
* GitHub's plans
* GitHub language support
* Types of GitHub accounts
* Access permissions
* GitHub Advanced Security
* Changes to GitHub plans
* GitHub glossary
* Learn to code
* Set up Copilot for learning
* Get started with Git
* Finding example code
* Reuse people's code
* Local development
* Debug with Copilot
* Getting feedback on your code
* Storing secrets safely
* Secure your code
* Secure your dependencies
* Accessibility
* Manage theme settings
* Keyboard shortcuts
* GitHub Command Palette
* Writing on GitHub
* Start writing on GitHub
* Quickstart
* About writing & formatting
* Basic formatting syntax
* Work with advanced formatting
* Organized data with tables
* Collapsed sections
* Create code blocks
* Create diagrams
* Mathematical expressions
* Auto linked references
* Attaching files
* About tasklists
* Permanent links to code
* Using keywords in issues and pull requests
* Work with saved replies
* About saved replies
* Creating a saved reply
* Editing a saved reply
* Deleting a saved reply
* Using saved replies
* Share content with gists
* Creating gists
* Forking and cloning gists
* Saving gists with stars
* Moderating gist comments
* Explore projects
* Discover projects
* Contribute to a project
* Finding open source projects
* Contribute to open source
* Use Copilot to explore projects
* Save repositories with stars
* Following people
* Following organizations
* Git basics
* Set up Git
* Set your username
* Caching credentials
* Repeated credential prompts
* macOS Keychain credentials
* Git workflows
* About remote repositories
* Manage remote repositories
* Associate text editors
* Handle line endings
* Ignoring files
* Git cheatsheet
* Using Git
* About Git
* Push commits to a remote
* Get changes from a remote
* Non-fast-forward error
* Splitting a subfolder
* About Git subtree merges
* About Git rebase
* Git rebase
* Resolve conflicts after rebase
* Special characters in names
* Maximum push limit
* Archive account and public repos
* Request account archive
* GitHub Archive program
* Using GitHub Docs
* Docs versions
* Hover cards
* GitHub Docs API
* GitHub Certifications
* About GitHub Certifications
* Registering for an exam
Git basics
Set up Git, a distributed version control system, to manage your GitHub repositories from your computer.
* Set up Git , 1 of 12
* Setting your username in Git , 2 of 12
* Caching your GitHub credentials in Git , 3 of 12
* Why is Git always asking for my credentials? , 4 of 12
* Updating credentials from the macOS Keychain , 5 of 12
* Git workflows , 6 of 12
* About remote repositories , 7 of 12
* Managing remote repositories , 8 of 12
* Associating text editors with Git , 9 of 12
* Configuring Git to handle line endings , 10 of 12
* Ignoring files , 11 of 12
* Git cheatsheet , 12 of 12
Help and support
Did you find what you needed?
Yes No
Privacy policy Help us make these docs great!
All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.
Make a contribution Learn how to contribute
Still need help?
Ask the GitHub community
Contact support
Legal
* © 2026 GitHub, Inc.
* Terms
* Privacy
* Status
* Pricing
* Expert services
* Blog
Links found on this page
- Skip to main content [direct]
- GitHub Docs [direct]
- Get started [direct]
- What is GitHub? [direct]
- Learning resources [direct]
- Create your repository [direct]
- Plan your work [direct]
- Connect locally [direct]
- Write and store code [direct]
- Review changes [direct]
- Deploy automatically [direct]
- Getting started with your GitHub account [direct]
- Getting started with GitHub Team [direct]
- Getting started with the GitHub Enterprise Cloud trial [direct]
- Getting started with GitHub Enterprise Cloud [direct]
- Hello World [direct]
- GitHub flow [direct]
- Connecting to GitHub [direct]
- Communicating on GitHub [direct]
- Feature preview [direct]
- Supported browsers [direct]
- GitHub Mobile [direct]
- Allow network access [direct]
- Connectivity problems [direct]
- GitHub's plans [direct]
- GitHub language support [direct]
- Types of GitHub accounts [direct]
- Access permissions [direct]
- GitHub Advanced Security [direct]
- Changes to GitHub plans [direct]
- GitHub glossary [direct]
- Set up Copilot for learning [direct]
- Get started with Git [direct]
- Finding example code [direct]
- Reuse people's code [direct]
- Local development [direct]
- Debug with Copilot [direct]
- Getting feedback on your code [direct]
- Storing secrets safely [direct]
- Secure your code [direct]
- Secure your dependencies [direct]
- Manage theme settings [direct]
- Keyboard shortcuts [direct]
- GitHub Command Palette [direct]
- Quickstart [direct]
- About writing & formatting [direct]
- Basic formatting syntax [direct]
- Organized data with tables [direct]
- Collapsed sections [direct]
- Create code blocks [direct]
- Create diagrams [direct]
- Mathematical expressions [direct]
- Auto linked references [direct]
- Attaching files [direct]
- About tasklists [direct]
- Permanent links to code [direct]
- Using keywords in issues and pull requests [direct]
- About saved replies [direct]
- Creating a saved reply [direct]
- Editing a saved reply [direct]
- Deleting a saved reply [direct]
- Using saved replies [direct]
- Creating gists [direct]
- Forking and cloning gists [direct]
- Saving gists with stars [direct]
- Moderating gist comments [direct]
- Discover projects [direct]
- Contribute to a project [direct]
- Finding open source projects [direct]
- Contribute to open source [direct]
- Use Copilot to explore projects [direct]
- Save repositories with stars [direct]
- Following people [direct]
- Following organizations [direct]
- Set up Git [direct]
- Set your username [direct]
- Caching credentials [direct]
- Repeated credential prompts [direct]
- macOS Keychain credentials [direct]
- Git workflows [direct]
|
|