🕷️ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 44 (from laksa050)

2. Crawled Status Check

Query:
Response:

3. Robots.txt Check

Query:
Response:

4. Spam/Ban Check

Query:
Response:

5. Seen Status Check

ℹ️ Skipped - page is already crawled

📄
INDEXABLE
CRAWLED
8 days ago
🤖
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH0.3 months ago
History dropPASSisNull(history_drop_reason)No drop reason
Spam/banPASSfh_dont_index != 1 AND ml_spam_score = 0ml_spam_score=0
CanonicalPASSmeta_canonical IS NULL OR = '' OR = src_unparsedNot set

Page Details

PropertyValue
URLhttps://www.atlassian.com/git/tutorials/using-branches/git-checkout
Last Crawled2026-04-01 03:12:13 (8 days ago)
First Indexed2014-09-20 14:45:30 (11 years ago)
HTTP Status Code200
Meta TitleGit Checkout | Atlassian Git Tutorial
Meta DescriptionGit branching intro. Create, list, rename, delete branches with git branch. git checkout: select which line of development you want and navigate branches
Meta Canonicalnull
Boilerpipe Text
This page is an examination of the git checkout command. It will cover usage examples and edge cases. In Git terms, a "checkout" is the act of switching between different versions of a target entity. The git checkout command operates upon three distinct entities: files, commits, and branches. In addition to the definition of "checkout" the phrase "checking out" is commonly used to imply the act of executing the git checkout command. In the Undoing Changes topic, we saw how git checkout can be used to view old commits. The focus for the majority of this document will be checkout operations on branches. Checking out branches is similar to checking out old commits and files in that the working directory is updated to match the selected branch/revision; however, new changes are saved in the project history—that is, it’s not a read-only operation. Checking out branches The git checkout command lets you navigate between the branches created by git branch . Checking out a branch updates the files in the working directory to match the version stored in that branch, and it tells Git to record all new commits on that branch. Think of it as a way to select which line of development you’re working on. Having a dedicated branch for each new feature is a dramatic shift from a traditional SVN workflow. It makes it ridiculously easy to try new experiments without the fear of destroying existing functionality, and it makes it possible to work on many unrelated features at the same time. In addition, branches also facilitate several collaborative workflows. The git checkout command may occasionally be confused with git clone . The difference between the two commands is that clone works to fetch code from a remote repository, alternatively checkout works to switch between versions of code already on the local system. Usage: Existing branches Assuming the repo you're working in contains pre-existing branches, you can switch between these branches using git checkout . To find out what branches are available and what the current branch name is, execute git branch . $> git branch main another_branch feature_inprogress_branch $> git checkout feature_inprogress_branch The above example demonstrates how to view a list of available branches by executing the git branch command, and switch to a specified branch, in this case, the feature_inprogress_branch . New branches Git checkout works hand-in-hand with git branch . The git branch command can be used to create a new branch. When you want to start a new feature, you create a new branch off main  using git branch new_branch . Once created you can then use git checkout new_branch to switch to that branch. Additionally, The git checkout command accepts a -b argument that acts as a convenience method which will create the new branch and immediately switch to it. You can work on multiple features in a single repository by switching between them with git checkout . git checkout -b <new-branch> The above example simultaneously creates and checks out <new-branch> . The -b option is a convenience flag that tells Git to run git branch <new-branch> before running git checkout <new-branch> . git checkout -b <new-branch> <existing-branch> By default git checkout -b will base the new-branch off the current HEAD . An optional additional branch parameter can be passed to git checkout . In the above example, <existing-branch> is passed which then bases new-branch off of existing-branch instead of the current HEAD . Switching branches Switching branches is a straightforward operation. Executing the following will point HEAD to the tip of <branchname>. git checkout <branchname> Git tracks a history of checkout operations in the reflog. You can execute git reflog to view the history. Git checkout a remote branch When collaborating with a team it is common to utilize remote repositories. These repositories may be hosted and shared or they may be another colleague's local copy. Each remote repository will contain its own set of branches. In order to checkout a remote branch you have to first fetch the contents of the branch. git fetch --all In modern versions of Git, you can then checkout the remote branch like a local branch. git checkout <remotebranch> Older versions of Git require the creation of a new branch based on the remote . git checkout -b <remotebranch> origin/<remotebranch> Additionally you can checkout a new local branch and reset it to the remote branches last commit. git checkout -b <branchname> git reset --hard origin/<branchname> Detached HEADS Now that we’ve seen the three main uses of git checkout on branches, it's important to discuss the “detached HEAD” state. Remember that the HEAD is Git’s way of referring to the current snapshot. Internally, the git checkout command simply updates the HEAD to point to either the specified branch or commit. When it points to a branch, Git doesn't complain, but when you check out a commit, it switches into a “detached HEAD” state. This is a warning telling you that everything you’re doing is “detached” from the rest of your project’s development. If you were to start developing a feature while in a detached HEAD state, there would be no branch allowing you to get back to it. When you inevitably check out another branch (e.g., to merge your feature in), there would be no way to reference your feature: The point is, your development should always take place on a branch—never on a detached HEAD . This makes sure you always have a reference to your new commits. However, if you’re just looking at an old commit, it doesn’t really matter if you’re in a detached HEAD state or not. Summary This page focused on usage of the git checkout command when changing branches. In summation, git checkout , when used on branches, alters the target of the HEAD ref. It can be used to create branches, switch branches, and checkout remote branches. The git checkout command is an essential tool for standard Git operation. It is a counterpart to git merge . The git checkout and git merge commands are critical tools to enabling git workflows .
Markdown
[Skip to content](https://www.atlassian.com/git/tutorials/using-branches/git-checkout#content) - [Products](https://www.atlassian.com/git/tutorials/using-branches/git-checkout) Featured Developers Product Managers IT professionals Business Teams Leadership Teams [See all apps](https://www.atlassian.com/software) - ## Featured apps - [**Jira** Flexible project management](https://www.atlassian.com/software/jira) - [**Confluence** Knowledge, all in one place](https://www.atlassian.com/software/confluence) - [**Jira Service Management** Deliver service at high velocity](https://www.atlassian.com/software/jira/service-management) ## Atlassian Collections - [Supercharge teamwork seamlessly JiraConfluenceLoom](https://www.atlassian.com/collections/teamwork) - [Optimize strategy and outcomes confidently FocusTalentAlign](https://www.atlassian.com/collections/strategy) - [Deliver service at high-velocity Jira Service ManagementCustomer Service ManagementAssets](https://www.atlassian.com/collections/service) - [Ship high-quality software fast Rovo DevDXPipelinesBitbucketCompass](https://www.atlassian.com/collections/software) Powered by [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) - [**Jira** Flexible project management](https://www.atlassian.com/software/jira) - [**Bitbucket** Source code and CI/CD](https://www.atlassian.com/software/bitbucket) - [**Rovo Dev** Agentic AI for developers](https://www.atlassian.com/software/rovo-dev) - [**Pipelines** Scalable CI/CD automation](https://www.atlassian.com/software/bitbucket/features/pipelines) - [**DX** Measure productivity and AI impact](https://www.atlassian.com/collections/software) - [**Compass** Software catalog for teams](https://www.atlassian.com/software/compass) - [Ship high-quality software fast Rovo DevDXPipelinesBitbucketCompass](https://www.atlassian.com/collections/software) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) - [**Jira Product Discovery** Capture & prioritize ideas](https://www.atlassian.com/software/jira/product-discovery) - [**Jira** Flexible project management](https://www.atlassian.com/software/jira) - [**Confluence** Knowledge, all in one place](https://www.atlassian.com/software/confluence) - [Supercharge teamwork seamlessly JiraConfluenceLoom](https://www.atlassian.com/collections/teamwork) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) - [**Jira Service Management** Deliver service at high velocity](https://www.atlassian.com/software/jira/service-management) - [**Guard** Enhanced cloud security](https://www.atlassian.com/software/guard) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) - [**Jira** Flexible project management](https://www.atlassian.com/software/jira) - [**Confluence** Knowledge, all in one place](https://www.atlassian.com/software/confluence) - [**Trello** Capture and organize your tasks](https://trello.com/home) - [**Loom** Quick, async video updates](https://www.atlassian.com/software/loom) - [**Jira Service Management** Deliver service at high velocity](https://www.atlassian.com/software/jira/service-management) - [**Customer Service Management** Customer experiences reimagined](https://www.atlassian.com/software/customer-service-management) - [Supercharge teamwork seamlessly JiraConfluenceLoom](https://www.atlassian.com/collections/teamwork) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) - [**Focus** Enterprise-scale strategic planning](https://www.atlassian.com/software/focus) - [**Talent** Knowledge workforce planning](https://www.atlassian.com/software/talent) - [**Align** Enterprise-wide work planning & value](https://www.atlassian.com/software/jira/align) - [Optimize strategy and outcomes confidently FocusTalentAlign](https://www.atlassian.com/collections/strategy) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) - [Solutions](https://www.atlassian.com/git/tutorials/using-branches/git-checkout) Solutions ## By Use Case - [Team collaboration](https://www.atlassian.com/collections/teamwork) - [Strategy and planning](https://www.atlassian.com/collections/strategy) - [Service management](https://www.atlassian.com/collections/service) - [Software development](https://www.atlassian.com/collections/software) ## By Team - [Software](https://www.atlassian.com/collections/software) - [Marketing](https://www.atlassian.com/teams/marketing) - [IT](https://www.atlassian.com/teams/it) - [Product](https://www.atlassian.com/software/jira/product-discovery%20) ## By Size - [Enterprise](https://www.atlassian.com/enterprise) - [Small Business](https://www.atlassian.com/software/small-business) - [Startup](https://www.atlassian.com/software/startups) - [Non-profit](https://www.atlassian.com/teams/nonprofits) ## By Industry - [Retail](https://www.atlassian.com/industries/retail) - [Telecommunications](https://www.atlassian.com/industries/telecom) - [Professional Services](https://www.atlassian.com/industries/professional-services) - [Government](https://www.atlassian.com/government) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) - [Why Atlassian?](https://www.atlassian.com/git/tutorials/using-branches/git-checkout) - [System of Work NewAtlassian's blueprint for how teams work together](https://www.atlassian.com/system-of-work) - [MarketplaceConnect thousands of apps to your Atlassian products](https://marketplace.atlassian.com/) - [CustomersCase studies & stories powered by teamwork](https://www.atlassian.com/customers) - [FedRAMPCompliant solutions for the public sector](https://www.atlassian.com/trust/compliance/resources/fedramp) - [ResilienceEnterprise-grade & highly performant infrastructure](https://www.atlassian.com/trust/resilience) - [PlatformOur deeply integrated, reliable & secure platform](https://www.atlassian.com/platform) - [Trust centerEnsure your data's security, compliance & availability](https://www.atlassian.com/trust) - [Resources](https://www.atlassian.com/git/tutorials/using-branches/git-checkout) - [Customer SupportAsk questions, report bugs & give us feedback](https://support.atlassian.com/) - [Find PartnersConsulting, training & product customization support](https://partnerdirectory.atlassian.com/) - [Atlassian AscendResources and support for your transformation](https://www.atlassian.com/migration) - [CommunityLearn, connect and grow with the Atlassian Community](https://community.atlassian.com/) ## Support ## Resources - [Enterprise](https://www.atlassian.com/enterprise) - More + Get it free Sign in Sign in - Products - Featured - Developers - Product Managers - IT professionals - Business Teams - Leadership Teams - Solutions - Why Atlassian? - Resources - [Enterprise](https://www.atlassian.com/enterprise) [Sign in](https://id.atlassian.com/login?continue=https%3A%2F%2Fwww.atlassian.com%2Fgateway%2Fapi%2Fstart%2Fauthredirect) - ## Featured apps - [Jira Flexible project management](https://www.atlassian.com/software/jira) - [Confluence Knowledge, all in one place](https://www.atlassian.com/software/confluence) - [Jira Service Management Deliver service at high velocity](https://www.atlassian.com/software/jira/service-management) ## Atlassian Collections - [Supercharge teamwork seamlessly JiraConfluenceLoom](https://www.atlassian.com/collections/teamwork) - [Optimize strategy and outcomes confidently FocusTalentAlign](https://www.atlassian.com/collections/strategy) - [Deliver service at high-velocity Jira Service ManagementCustomer Service ManagementAssets](https://www.atlassian.com/collections/service) - [Ship high-quality software fast Rovo DevDXPipelinesBitbucketCompass](https://www.atlassian.com/collections/software) Powered by [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) Developers - [**Jira** Flexible project management](https://www.atlassian.com/software/jira) - [**Bitbucket** Source code and CI/CD](https://www.atlassian.com/software/bitbucket) - [**Rovo Dev** Agentic AI for developers](https://www.atlassian.com/software/rovo-dev) - [**Pipelines** Scalable CI/CD automation](https://www.atlassian.com/software/bitbucket/features/pipelines) - [**DX** Measure productivity and AI impact](https://www.atlassian.com/collections/software) - [**Compass** Software catalog for teams](https://www.atlassian.com/software/compass) - [Ship high-quality software fast Rovo DevDXPipelinesBitbucketCompass](https://www.atlassian.com/collections/software) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) Product Managers - [**Jira Product Discovery** Capture & prioritize ideas](https://www.atlassian.com/software/jira/product-discovery) - [**Jira** Flexible project management](https://www.atlassian.com/software/jira) - [**Confluence** Knowledge, all in one place](https://www.atlassian.com/software/confluence) - [Supercharge teamwork seamlessly JiraConfluenceLoom](https://www.atlassian.com/collections/teamwork) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) IT professionals - [**Jira Service Management** Deliver service at high velocity](https://www.atlassian.com/software/jira/service-management) - [**Guard** Enhanced cloud security](https://www.atlassian.com/software/guard) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) Business Teams - [**Jira** Flexible project management](https://www.atlassian.com/software/jira) - [**Confluence** Knowledge, all in one place](https://www.atlassian.com/software/confluence) - [**Trello** Capture and organize your tasks](https://trello.com/home) - [**Loom** Quick, async video updates](https://www.atlassian.com/software/loom) - [**Jira Service Management** Deliver service at high velocity](https://www.atlassian.com/software/jira/service-management) - [**Customer Service Management** Customer experiences reimagined](https://www.atlassian.com/software/customer-service-management) - [Supercharge teamwork seamlessly JiraConfluenceLoom](https://www.atlassian.com/collections/teamwork) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) Leadership Teams - [**Focus** Enterprise-scale strategic planning](https://www.atlassian.com/software/focus) - [**Talent** Knowledge workforce planning](https://www.atlassian.com/software/talent) - [**Align** Enterprise-wide work planning & value](https://www.atlassian.com/software/jira/align) - [Optimize strategy and outcomes confidently FocusTalentAlign](https://www.atlassian.com/collections/strategy) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) Solutions ## By Use Case - [Team collaboration](https://www.atlassian.com/collections/teamwork) - [Strategy and planning](https://www.atlassian.com/collections/strategy) - [Service management](https://www.atlassian.com/collections/service) - [Software development](https://www.atlassian.com/collections/software) ## By Team - [Software](https://www.atlassian.com/collections/software) - [Marketing](https://www.atlassian.com/teams/marketing) - [IT](https://www.atlassian.com/teams/it) - [Product](https://www.atlassian.com/software/jira/product-discovery%20) ## By Size - [Enterprise](https://www.atlassian.com/enterprise) - [Small Business](https://www.atlassian.com/software/small-business) - [Startup](https://www.atlassian.com/software/startups) - [Non-profit](https://www.atlassian.com/teams/nonprofits) ## By Industry - [Retail](https://www.atlassian.com/industries/retail) - [Telecommunications](https://www.atlassian.com/industries/telecom) - [Professional Services](https://www.atlassian.com/industries/professional-services) - [Government](https://www.atlassian.com/government) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) Why Atlassian [System of Work NewAtlassian's blueprint for how teams work together](https://www.atlassian.com/system-of-work) [MarketplaceConnect thousands of apps to your Atlassian products](https://marketplace.atlassian.com/) [CustomersCase studies & stories powered by teamwork](https://www.atlassian.com/customers) [FedRAMPCompliant solutions for the public sector](https://www.atlassian.com/trust/compliance/resources/fedramp) [ResilienceEnterprise-grade & highly performant infrastructure](https://www.atlassian.com/trust/resilience) [PlatformOur deeply integrated, reliable & secure platform](https://www.atlassian.com/platform) [Trust centerEnsure your data's security, compliance & availability](https://www.atlassian.com/trust) Resources [Customer SupportAsk questions, report bugs & give us feedback](https://support.atlassian.com/) [Find PartnersConsulting, training & product customization support](https://partnerdirectory.atlassian.com/) [Atlassian AscendResources and support for your transformation](https://www.atlassian.com/migration) [CommunityLearn, connect and grow with the Atlassian Community](https://community.atlassian.com/) Support - [General Inquiries](https://www.atlassian.com/company/contact/general-inquiries) - [Technical Support](https://support.atlassian.com/contact/) - [Product Advice](https://www.atlassian.com/company/contact/product-evaluator-advice) - [Pricing and Billing](https://www.atlassian.com/company/contact/purchasing-licensing) - [Partner Support](https://www.atlassian.com/partners) - [Developer Support](https://developer.atlassian.com/) - [Enterprise Support](https://www.atlassian.com/enterprise/services) - [Purchasing and Licensing](https://www.atlassian.com/licensing/purchase-licensing) Resources - [Project Management](https://www.atlassian.com/project-management) - [Project Collaboration](https://www.atlassian.com/work-management/project-collaboration) - [Agile](https://www.atlassian.com/agile) - [Team Playbook](https://www.atlassian.com/team-playbook) - [Atlassian Learning](https://community.atlassian.com/learning) - [Product Documentation](https://confluence.atlassian.com/display/ALLDOC/Atlassian+Documentation) - [Get Started](https://www.atlassian.com/get-started) [Skip to content](https://www.atlassian.com/git/tutorials/using-branches/git-checkout#content) - Products - Featured - Developers - Product Managers - IT professionals - Business Teams - Leadership Teams - Solutions - Why Atlassian? - Resources - [Enterprise](https://www.atlassian.com/enterprise) [Sign in](https://id.atlassian.com/login?continue=https%3A%2F%2Fwww.atlassian.com%2Fgateway%2Fapi%2Fstart%2Fauthredirect) - ## Featured apps - [Jira Flexible project management](https://www.atlassian.com/software/jira) - [Confluence Knowledge, all in one place](https://www.atlassian.com/software/confluence) - [Jira Service Management Deliver service at high velocity](https://www.atlassian.com/software/jira/service-management) ## Atlassian Collections - [Supercharge teamwork seamlessly JiraConfluenceLoom](https://www.atlassian.com/collections/teamwork) - [Optimize strategy and outcomes confidently FocusTalentAlign](https://www.atlassian.com/collections/strategy) - [Deliver service at high-velocity Jira Service ManagementCustomer Service ManagementAssets](https://www.atlassian.com/collections/service) - [Ship high-quality software fast Rovo DevDXPipelinesBitbucketCompass](https://www.atlassian.com/collections/software) Powered by [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) Developers - [**Jira** Flexible project management](https://www.atlassian.com/software/jira) - [**Bitbucket** Source code and CI/CD](https://www.atlassian.com/software/bitbucket) - [**Rovo Dev** Agentic AI for developers](https://www.atlassian.com/software/rovo-dev) - [**Pipelines** Scalable CI/CD automation](https://www.atlassian.com/software/bitbucket/features/pipelines) - [**DX** Measure productivity and AI impact](https://www.atlassian.com/collections/software) - [**Compass** Software catalog for teams](https://www.atlassian.com/software/compass) - [Ship high-quality software fast Rovo DevDXPipelinesBitbucketCompass](https://www.atlassian.com/collections/software) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) Product Managers - [**Jira Product Discovery** Capture & prioritize ideas](https://www.atlassian.com/software/jira/product-discovery) - [**Jira** Flexible project management](https://www.atlassian.com/software/jira) - [**Confluence** Knowledge, all in one place](https://www.atlassian.com/software/confluence) - [Supercharge teamwork seamlessly JiraConfluenceLoom](https://www.atlassian.com/collections/teamwork) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) IT professionals - [**Jira Service Management** Deliver service at high velocity](https://www.atlassian.com/software/jira/service-management) - [**Guard** Enhanced cloud security](https://www.atlassian.com/software/guard) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) Business Teams - [**Jira** Flexible project management](https://www.atlassian.com/software/jira) - [**Confluence** Knowledge, all in one place](https://www.atlassian.com/software/confluence) - [**Trello** Capture and organize your tasks](https://trello.com/home) - [**Loom** Quick, async video updates](https://www.atlassian.com/software/loom) - [**Jira Service Management** Deliver service at high velocity](https://www.atlassian.com/software/jira/service-management) - [**Customer Service Management** Customer experiences reimagined](https://www.atlassian.com/software/customer-service-management) - [Supercharge teamwork seamlessly JiraConfluenceLoom](https://www.atlassian.com/collections/teamwork) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) Leadership Teams - [**Focus** Enterprise-scale strategic planning](https://www.atlassian.com/software/focus) - [**Talent** Knowledge workforce planning](https://www.atlassian.com/software/talent) - [**Align** Enterprise-wide work planning & value](https://www.atlassian.com/software/jira/align) - [Optimize strategy and outcomes confidently FocusTalentAlign](https://www.atlassian.com/collections/strategy) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) Solutions ## By Use Case - [Team collaboration](https://www.atlassian.com/collections/teamwork) - [Strategy and planning](https://www.atlassian.com/collections/strategy) - [Service management](https://www.atlassian.com/collections/service) - [Software development](https://www.atlassian.com/collections/software) ## By Team - [Software](https://www.atlassian.com/collections/software) - [Marketing](https://www.atlassian.com/teams/marketing) - [IT](https://www.atlassian.com/teams/it) - [Product](https://www.atlassian.com/software/jira/product-discovery%20) ## By Size - [Enterprise](https://www.atlassian.com/enterprise) - [Small Business](https://www.atlassian.com/software/small-business) - [Startup](https://www.atlassian.com/software/startups) - [Non-profit](https://www.atlassian.com/teams/nonprofits) ## By Industry - [Retail](https://www.atlassian.com/industries/retail) - [Telecommunications](https://www.atlassian.com/industries/telecom) - [Professional Services](https://www.atlassian.com/industries/professional-services) - [Government](https://www.atlassian.com/government) [Rovo AI-powered apps – driven by your team's knowledge.](https://www.atlassian.com/software/rovo) Why Atlassian [System of Work NewAtlassian's blueprint for how teams work together](https://www.atlassian.com/system-of-work) [MarketplaceConnect thousands of apps to your Atlassian products](https://marketplace.atlassian.com/) [CustomersCase studies & stories powered by teamwork](https://www.atlassian.com/customers) [FedRAMPCompliant solutions for the public sector](https://www.atlassian.com/trust/compliance/resources/fedramp) [ResilienceEnterprise-grade & highly performant infrastructure](https://www.atlassian.com/trust/resilience) [PlatformOur deeply integrated, reliable & secure platform](https://www.atlassian.com/platform) [Trust centerEnsure your data's security, compliance & availability](https://www.atlassian.com/trust) Resources [Customer SupportAsk questions, report bugs & give us feedback](https://support.atlassian.com/) [Find PartnersConsulting, training & product customization support](https://partnerdirectory.atlassian.com/) [Atlassian AscendResources and support for your transformation](https://www.atlassian.com/migration) [CommunityLearn, connect and grow with the Atlassian Community](https://community.atlassian.com/) Support - [General Inquiries](https://www.atlassian.com/company/contact/general-inquiries) - [Technical Support](https://support.atlassian.com/contact/) - [Product Advice](https://www.atlassian.com/company/contact/product-evaluator-advice) - [Pricing and Billing](https://www.atlassian.com/company/contact/purchasing-licensing) - [Partner Support](https://www.atlassian.com/partners) - [Developer Support](https://developer.atlassian.com/) - [Enterprise Support](https://www.atlassian.com/enterprise/services) - [Purchasing and Licensing](https://www.atlassian.com/licensing/purchase-licensing) Resources - [Project Management](https://www.atlassian.com/project-management) - [Project Collaboration](https://www.atlassian.com/work-management/project-collaboration) - [Agile](https://www.atlassian.com/agile) - [Team Playbook](https://www.atlassian.com/team-playbook) - [Atlassian Learning](https://community.atlassian.com/learning) - [Product Documentation](https://confluence.atlassian.com/display/ALLDOC/Atlassian+Documentation) - [Get Started](https://www.atlassian.com/get-started) Git topics - Learn Git - [Git commands](https://www.atlassian.com/git/glossary) - [Learn Git with Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud) - [Learn about code review in Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-about-code-review-in-bitbucket-cloud) - [Learn Branching with Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-branching-with-bitbucket-cloud) - [Learn Undoing Changes with Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-undoing-changes-with-bitbucket) - Beginner - [What is version control](https://www.atlassian.com/git/tutorials/what-is-version-control) - [Source Code Management](https://www.atlassian.com/git/tutorials/source-code-management) - [What is Git](https://www.atlassian.com/git/tutorials/what-is-git) - [Why Git for your organization](https://www.atlassian.com/git/tutorials/why-git) - [Install Git](https://www.atlassian.com/git/tutorials/install-git) - [Git SSH](https://www.atlassian.com/git/tutorials/git-ssh) - [Git archive](https://www.atlassian.com/git/tutorials/export-git-archive) - [GitOps](https://www.atlassian.com/git/tutorials/gitops) - [Git cheat sheet](https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet) - Getting started - Setting up a repository - [Overview](https://www.atlassian.com/git/tutorials/setting-up-a-repository) - [git init](https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-init) - [git clone](https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-clone) - [git config](https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config) - [git alias](https://www.atlassian.com/git/tutorials/git-alias) - Saving changes (Git add) - [Overview](https://www.atlassian.com/git/tutorials/saving-changes) - [git commit](https://www.atlassian.com/git/tutorials/saving-changes/git-commit) - [git diff](https://www.atlassian.com/git/tutorials/saving-changes/git-diff) - [git stash](https://www.atlassian.com/git/tutorials/saving-changes/git-stash) - [.gitignore](https://www.atlassian.com/git/tutorials/saving-changes/gitignore) - Inspecting a repository - [Overview](https://www.atlassian.com/git/tutorials/inspecting-a-repository) - [git tag](https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-tag) - [git blame](https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-blame) - Undoing changes - [Overview](https://www.atlassian.com/git/tutorials/undoing-changes) - [git clean](https://www.atlassian.com/git/tutorials/undoing-changes/git-clean) - [git revert](https://www.atlassian.com/git/tutorials/undoing-changes/git-revert) - [git reset](https://www.atlassian.com/git/tutorials/undoing-changes/git-reset) - [git rm](https://www.atlassian.com/git/tutorials/undoing-changes/git-rm) - Rewriting history - [Overview](https://www.atlassian.com/git/tutorials/rewriting-history) - [git rebase](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase) - [git reflog](https://www.atlassian.com/git/tutorials/rewriting-history/git-reflog) - Collaborating workflows - Syncing (git remote) - [Overview](https://www.atlassian.com/git/tutorials/syncing) - [git fetch](https://www.atlassian.com/git/tutorials/syncing/git-fetch) - [git push](https://www.atlassian.com/git/tutorials/syncing/git-push) - [git pull](https://www.atlassian.com/git/tutorials/syncing/git-pull) - [Making a Pull Request](https://www.atlassian.com/git/tutorials/making-a-pull-request) - Using Branches (Git branch) - [Overview](https://www.atlassian.com/git/tutorials/using-branches) - [git checkout](https://www.atlassian.com/git/tutorials/using-branches/git-checkout) - [git merge](https://www.atlassian.com/git/tutorials/using-branches/git-merge) - [Merge conflicts](https://www.atlassian.com/git/tutorials/using-branches/merge-conflicts) - [Merge strategies](https://www.atlassian.com/git/tutorials/using-branches/merge-strategy) - Comparing Workflows - [Overview](https://www.atlassian.com/git/tutorials/comparing-workflows) - [Feature Branch Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow) - [Gitflow Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) - [Forking Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow) - Migrating to Git - [SVN to Git - prepping for the migration](https://www.atlassian.com/git/tutorials/svn-to-git-prepping-your-team-migration) - Migrate to Git from SVN - [Overview](https://www.atlassian.com/git/tutorials/migrating-overview) - [Prepare](https://www.atlassian.com/git/tutorials/migrating-prepare) - [Convert](https://www.atlassian.com/git/tutorials/migrating-convert) - [Synchronize](https://www.atlassian.com/git/tutorials/migrating-synchronize) - [Share](https://www.atlassian.com/git/tutorials/migrating-share) - [Migrate](https://www.atlassian.com/git/tutorials/migrating-migrate) - [Perforce to Git - why to make the move](https://www.atlassian.com/git/tutorials/perforce-git) - [Migrating from Perforce to Git](https://www.atlassian.com/git/tutorials/perforce-git-migration) - [Working with Git and Perforce: integration workflow](https://www.atlassian.com/git/tutorials/git-p4) - [How to move a Git repository with history](https://www.atlassian.com/git/tutorials/git-move-repository) - Advanced Tips - [Overview](https://www.atlassian.com/git/tutorials/advanced-overview) - [Merging vs. Rebasing](https://www.atlassian.com/git/tutorials/merging-vs-rebasing) - [Reset, Checkout, and Revert](https://www.atlassian.com/git/tutorials/resetting-checking-out-and-reverting) - [Advanced Git log](https://www.atlassian.com/git/tutorials/git-log) - [Git Hooks](https://www.atlassian.com/git/tutorials/git-hooks) - [Refs and the Reflog](https://www.atlassian.com/git/tutorials/refs-and-the-reflog) - [Git submodules](https://www.atlassian.com/git/tutorials/git-submodule) - [Git subtree](https://www.atlassian.com/git/tutorials/git-subtree) - [Large repositories in Git](https://www.atlassian.com/git/tutorials/big-repositories) - [Git LFS](https://www.atlassian.com/git/tutorials/git-lfs) - [Git gc](https://www.atlassian.com/git/tutorials/git-gc) - [Git prune](https://www.atlassian.com/git/tutorials/git-prune) - [Git bash](https://www.atlassian.com/git/tutorials/git-bash) - [How to store dotfiles](https://www.atlassian.com/git/tutorials/dotfiles) - [Git cherry pick](https://www.atlassian.com/git/tutorials/cherry-pick) - [GitK](https://www.atlassian.com/git/tutorials/gitk) - [Git-show](https://www.atlassian.com/git/tutorials/git-show) - Articles - [Dealing with Maven dependencies when switching to Git](https://www.atlassian.com/git/articles/maven-dependencies-versions-merging) - [Pull request proficiency: Fetching abilities unlocked\!](https://www.atlassian.com/git/articles/pull-request-proficiency-fetching-abilities-unlocked) - [Git and project dependencies](https://www.atlassian.com/git/articles/git-and-project-dependencies) - [Git or SVN? How Nuance Healthcare Chose a Git Branching Model](https://www.atlassian.com/git/articles/git-or-svn-git-branching-model) - [Git Forks And Upstreams: How-to and a cool tip](https://www.atlassian.com/git/tutorials/git-forks-and-upstreams) - [Core concept, workflows and tips](https://www.atlassian.com/git/articles/core-concept-workflows-and-tips) Git topics - Learn Git - [Git commands](https://www.atlassian.com/git/glossary) - [Learn Git with Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud) - [Learn about code review in Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-about-code-review-in-bitbucket-cloud) - [Learn Branching with Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-branching-with-bitbucket-cloud) - [Learn Undoing Changes with Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-undoing-changes-with-bitbucket) - Beginner - [What is version control](https://www.atlassian.com/git/tutorials/what-is-version-control) - [Source Code Management](https://www.atlassian.com/git/tutorials/source-code-management) - [What is Git](https://www.atlassian.com/git/tutorials/what-is-git) - [Why Git for your organization](https://www.atlassian.com/git/tutorials/why-git) - [Install Git](https://www.atlassian.com/git/tutorials/install-git) - [Git SSH](https://www.atlassian.com/git/tutorials/git-ssh) - [Git archive](https://www.atlassian.com/git/tutorials/export-git-archive) - [GitOps](https://www.atlassian.com/git/tutorials/gitops) - [Git cheat sheet](https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet) - Getting started - Setting up a repository - [Overview](https://www.atlassian.com/git/tutorials/setting-up-a-repository) - [git init](https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-init) - [git clone](https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-clone) - [git config](https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config) - [git alias](https://www.atlassian.com/git/tutorials/git-alias) - Saving changes (Git add) - [Overview](https://www.atlassian.com/git/tutorials/saving-changes) - [git commit](https://www.atlassian.com/git/tutorials/saving-changes/git-commit) - [git diff](https://www.atlassian.com/git/tutorials/saving-changes/git-diff) - [git stash](https://www.atlassian.com/git/tutorials/saving-changes/git-stash) - [.gitignore](https://www.atlassian.com/git/tutorials/saving-changes/gitignore) - Inspecting a repository - [Overview](https://www.atlassian.com/git/tutorials/inspecting-a-repository) - [git tag](https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-tag) - [git blame](https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-blame) - Undoing changes - [Overview](https://www.atlassian.com/git/tutorials/undoing-changes) - [git clean](https://www.atlassian.com/git/tutorials/undoing-changes/git-clean) - [git revert](https://www.atlassian.com/git/tutorials/undoing-changes/git-revert) - [git reset](https://www.atlassian.com/git/tutorials/undoing-changes/git-reset) - [git rm](https://www.atlassian.com/git/tutorials/undoing-changes/git-rm) - Rewriting history - [Overview](https://www.atlassian.com/git/tutorials/rewriting-history) - [git rebase](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase) - [git reflog](https://www.atlassian.com/git/tutorials/rewriting-history/git-reflog) - Collaborating workflows - Syncing (git remote) - [Overview](https://www.atlassian.com/git/tutorials/syncing) - [git fetch](https://www.atlassian.com/git/tutorials/syncing/git-fetch) - [git push](https://www.atlassian.com/git/tutorials/syncing/git-push) - [git pull](https://www.atlassian.com/git/tutorials/syncing/git-pull) - [Making a Pull Request](https://www.atlassian.com/git/tutorials/making-a-pull-request) - Using Branches (Git branch) - [Overview](https://www.atlassian.com/git/tutorials/using-branches) - [git checkout](https://www.atlassian.com/git/tutorials/using-branches/git-checkout) - [git merge](https://www.atlassian.com/git/tutorials/using-branches/git-merge) - [Merge conflicts](https://www.atlassian.com/git/tutorials/using-branches/merge-conflicts) - [Merge strategies](https://www.atlassian.com/git/tutorials/using-branches/merge-strategy) - Comparing Workflows - [Overview](https://www.atlassian.com/git/tutorials/comparing-workflows) - [Feature Branch Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow) - [Gitflow Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) - [Forking Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow) - Migrating to Git - [SVN to Git - prepping for the migration](https://www.atlassian.com/git/tutorials/svn-to-git-prepping-your-team-migration) - Migrate to Git from SVN - [Overview](https://www.atlassian.com/git/tutorials/migrating-overview) - [Prepare](https://www.atlassian.com/git/tutorials/migrating-prepare) - [Convert](https://www.atlassian.com/git/tutorials/migrating-convert) - [Synchronize](https://www.atlassian.com/git/tutorials/migrating-synchronize) - [Share](https://www.atlassian.com/git/tutorials/migrating-share) - [Migrate](https://www.atlassian.com/git/tutorials/migrating-migrate) - [Perforce to Git - why to make the move](https://www.atlassian.com/git/tutorials/perforce-git) - [Migrating from Perforce to Git](https://www.atlassian.com/git/tutorials/perforce-git-migration) - [Working with Git and Perforce: integration workflow](https://www.atlassian.com/git/tutorials/git-p4) - [How to move a Git repository with history](https://www.atlassian.com/git/tutorials/git-move-repository) - Advanced Tips - [Overview](https://www.atlassian.com/git/tutorials/advanced-overview) - [Merging vs. Rebasing](https://www.atlassian.com/git/tutorials/merging-vs-rebasing) - [Reset, Checkout, and Revert](https://www.atlassian.com/git/tutorials/resetting-checking-out-and-reverting) - [Advanced Git log](https://www.atlassian.com/git/tutorials/git-log) - [Git Hooks](https://www.atlassian.com/git/tutorials/git-hooks) - [Refs and the Reflog](https://www.atlassian.com/git/tutorials/refs-and-the-reflog) - [Git submodules](https://www.atlassian.com/git/tutorials/git-submodule) - [Git subtree](https://www.atlassian.com/git/tutorials/git-subtree) - [Large repositories in Git](https://www.atlassian.com/git/tutorials/big-repositories) - [Git LFS](https://www.atlassian.com/git/tutorials/git-lfs) - [Git gc](https://www.atlassian.com/git/tutorials/git-gc) - [Git prune](https://www.atlassian.com/git/tutorials/git-prune) - [Git bash](https://www.atlassian.com/git/tutorials/git-bash) - [How to store dotfiles](https://www.atlassian.com/git/tutorials/dotfiles) - [Git cherry pick](https://www.atlassian.com/git/tutorials/cherry-pick) - [GitK](https://www.atlassian.com/git/tutorials/gitk) - [Git-show](https://www.atlassian.com/git/tutorials/git-show) - Articles - [Dealing with Maven dependencies when switching to Git](https://www.atlassian.com/git/articles/maven-dependencies-versions-merging) - [Pull request proficiency: Fetching abilities unlocked\!](https://www.atlassian.com/git/articles/pull-request-proficiency-fetching-abilities-unlocked) - [Git and project dependencies](https://www.atlassian.com/git/articles/git-and-project-dependencies) - [Git or SVN? How Nuance Healthcare Chose a Git Branching Model](https://www.atlassian.com/git/articles/git-or-svn-git-branching-model) - [Git Forks And Upstreams: How-to and a cool tip](https://www.atlassian.com/git/tutorials/git-forks-and-upstreams) - [Core concept, workflows and tips](https://www.atlassian.com/git/articles/core-concept-workflows-and-tips) Git topics - Learn Git - [Git commands](https://www.atlassian.com/git/glossary) - [Learn Git with Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud) - [Learn about code review in Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-about-code-review-in-bitbucket-cloud) - [Learn Branching with Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-branching-with-bitbucket-cloud) - [Learn Undoing Changes with Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-undoing-changes-with-bitbucket) - Beginner - [What is version control](https://www.atlassian.com/git/tutorials/what-is-version-control) - [Source Code Management](https://www.atlassian.com/git/tutorials/source-code-management) - [What is Git](https://www.atlassian.com/git/tutorials/what-is-git) - [Why Git for your organization](https://www.atlassian.com/git/tutorials/why-git) - [Install Git](https://www.atlassian.com/git/tutorials/install-git) - [Git SSH](https://www.atlassian.com/git/tutorials/git-ssh) - [Git archive](https://www.atlassian.com/git/tutorials/export-git-archive) - [GitOps](https://www.atlassian.com/git/tutorials/gitops) - [Git cheat sheet](https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet) - Getting started - Setting up a repository - [Overview](https://www.atlassian.com/git/tutorials/setting-up-a-repository) - [git init](https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-init) - [git clone](https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-clone) - [git config](https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config) - [git alias](https://www.atlassian.com/git/tutorials/git-alias) - Saving changes (Git add) - [Overview](https://www.atlassian.com/git/tutorials/saving-changes) - [git commit](https://www.atlassian.com/git/tutorials/saving-changes/git-commit) - [git diff](https://www.atlassian.com/git/tutorials/saving-changes/git-diff) - [git stash](https://www.atlassian.com/git/tutorials/saving-changes/git-stash) - [.gitignore](https://www.atlassian.com/git/tutorials/saving-changes/gitignore) - Inspecting a repository - [Overview](https://www.atlassian.com/git/tutorials/inspecting-a-repository) - [git tag](https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-tag) - [git blame](https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-blame) - Undoing changes - [Overview](https://www.atlassian.com/git/tutorials/undoing-changes) - [git clean](https://www.atlassian.com/git/tutorials/undoing-changes/git-clean) - [git revert](https://www.atlassian.com/git/tutorials/undoing-changes/git-revert) - [git reset](https://www.atlassian.com/git/tutorials/undoing-changes/git-reset) - [git rm](https://www.atlassian.com/git/tutorials/undoing-changes/git-rm) - Rewriting history - [Overview](https://www.atlassian.com/git/tutorials/rewriting-history) - [git rebase](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase) - [git reflog](https://www.atlassian.com/git/tutorials/rewriting-history/git-reflog) - Collaborating workflows - Syncing (git remote) - [Overview](https://www.atlassian.com/git/tutorials/syncing) - [git fetch](https://www.atlassian.com/git/tutorials/syncing/git-fetch) - [git push](https://www.atlassian.com/git/tutorials/syncing/git-push) - [git pull](https://www.atlassian.com/git/tutorials/syncing/git-pull) - [Making a Pull Request](https://www.atlassian.com/git/tutorials/making-a-pull-request) - Using Branches (Git branch) - [Overview](https://www.atlassian.com/git/tutorials/using-branches) - [git checkout](https://www.atlassian.com/git/tutorials/using-branches/git-checkout) - [git merge](https://www.atlassian.com/git/tutorials/using-branches/git-merge) - [Merge conflicts](https://www.atlassian.com/git/tutorials/using-branches/merge-conflicts) - [Merge strategies](https://www.atlassian.com/git/tutorials/using-branches/merge-strategy) - Comparing Workflows - [Overview](https://www.atlassian.com/git/tutorials/comparing-workflows) - [Feature Branch Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow) - [Gitflow Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) - [Forking Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow) - Migrating to Git - [SVN to Git - prepping for the migration](https://www.atlassian.com/git/tutorials/svn-to-git-prepping-your-team-migration) - Migrate to Git from SVN - [Overview](https://www.atlassian.com/git/tutorials/migrating-overview) - [Prepare](https://www.atlassian.com/git/tutorials/migrating-prepare) - [Convert](https://www.atlassian.com/git/tutorials/migrating-convert) - [Synchronize](https://www.atlassian.com/git/tutorials/migrating-synchronize) - [Share](https://www.atlassian.com/git/tutorials/migrating-share) - [Migrate](https://www.atlassian.com/git/tutorials/migrating-migrate) - [Perforce to Git - why to make the move](https://www.atlassian.com/git/tutorials/perforce-git) - [Migrating from Perforce to Git](https://www.atlassian.com/git/tutorials/perforce-git-migration) - [Working with Git and Perforce: integration workflow](https://www.atlassian.com/git/tutorials/git-p4) - [How to move a Git repository with history](https://www.atlassian.com/git/tutorials/git-move-repository) - Advanced Tips - [Overview](https://www.atlassian.com/git/tutorials/advanced-overview) - [Merging vs. Rebasing](https://www.atlassian.com/git/tutorials/merging-vs-rebasing) - [Reset, Checkout, and Revert](https://www.atlassian.com/git/tutorials/resetting-checking-out-and-reverting) - [Advanced Git log](https://www.atlassian.com/git/tutorials/git-log) - [Git Hooks](https://www.atlassian.com/git/tutorials/git-hooks) - [Refs and the Reflog](https://www.atlassian.com/git/tutorials/refs-and-the-reflog) - [Git submodules](https://www.atlassian.com/git/tutorials/git-submodule) - [Git subtree](https://www.atlassian.com/git/tutorials/git-subtree) - [Large repositories in Git](https://www.atlassian.com/git/tutorials/big-repositories) - [Git LFS](https://www.atlassian.com/git/tutorials/git-lfs) - [Git gc](https://www.atlassian.com/git/tutorials/git-gc) - [Git prune](https://www.atlassian.com/git/tutorials/git-prune) - [Git bash](https://www.atlassian.com/git/tutorials/git-bash) - [How to store dotfiles](https://www.atlassian.com/git/tutorials/dotfiles) - [Git cherry pick](https://www.atlassian.com/git/tutorials/cherry-pick) - [GitK](https://www.atlassian.com/git/tutorials/gitk) - [Git-show](https://www.atlassian.com/git/tutorials/git-show) - Articles - [Dealing with Maven dependencies when switching to Git](https://www.atlassian.com/git/articles/maven-dependencies-versions-merging) - [Pull request proficiency: Fetching abilities unlocked\!](https://www.atlassian.com/git/articles/pull-request-proficiency-fetching-abilities-unlocked) - [Git and project dependencies](https://www.atlassian.com/git/articles/git-and-project-dependencies) - [Git or SVN? How Nuance Healthcare Chose a Git Branching Model](https://www.atlassian.com/git/articles/git-or-svn-git-branching-model) - [Git Forks And Upstreams: How-to and a cool tip](https://www.atlassian.com/git/tutorials/git-forks-and-upstreams) - [Core concept, workflows and tips](https://www.atlassian.com/git/articles/core-concept-workflows-and-tips) Git topics - Learn Git - [Git commands](https://www.atlassian.com/git/glossary) - [Learn Git with Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud) - [Learn about code review in Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-about-code-review-in-bitbucket-cloud) - [Learn Branching with Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-branching-with-bitbucket-cloud) - [Learn Undoing Changes with Bitbucket Cloud](https://www.atlassian.com/git/tutorials/learn-undoing-changes-with-bitbucket) - Beginner - [What is version control](https://www.atlassian.com/git/tutorials/what-is-version-control) - [Source Code Management](https://www.atlassian.com/git/tutorials/source-code-management) - [What is Git](https://www.atlassian.com/git/tutorials/what-is-git) - [Why Git for your organization](https://www.atlassian.com/git/tutorials/why-git) - [Install Git](https://www.atlassian.com/git/tutorials/install-git) - [Git SSH](https://www.atlassian.com/git/tutorials/git-ssh) - [Git archive](https://www.atlassian.com/git/tutorials/export-git-archive) - [GitOps](https://www.atlassian.com/git/tutorials/gitops) - [Git cheat sheet](https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet) - Getting started - Setting up a repository - [Overview](https://www.atlassian.com/git/tutorials/setting-up-a-repository) - [git init](https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-init) - [git clone](https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-clone) - [git config](https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config) - [git alias](https://www.atlassian.com/git/tutorials/git-alias) - Saving changes (Git add) - [Overview](https://www.atlassian.com/git/tutorials/saving-changes) - [git commit](https://www.atlassian.com/git/tutorials/saving-changes/git-commit) - [git diff](https://www.atlassian.com/git/tutorials/saving-changes/git-diff) - [git stash](https://www.atlassian.com/git/tutorials/saving-changes/git-stash) - [.gitignore](https://www.atlassian.com/git/tutorials/saving-changes/gitignore) - Inspecting a repository - [Overview](https://www.atlassian.com/git/tutorials/inspecting-a-repository) - [git tag](https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-tag) - [git blame](https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-blame) - Undoing changes - [Overview](https://www.atlassian.com/git/tutorials/undoing-changes) - [git clean](https://www.atlassian.com/git/tutorials/undoing-changes/git-clean) - [git revert](https://www.atlassian.com/git/tutorials/undoing-changes/git-revert) - [git reset](https://www.atlassian.com/git/tutorials/undoing-changes/git-reset) - [git rm](https://www.atlassian.com/git/tutorials/undoing-changes/git-rm) - Rewriting history - [Overview](https://www.atlassian.com/git/tutorials/rewriting-history) - [git rebase](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase) - [git reflog](https://www.atlassian.com/git/tutorials/rewriting-history/git-reflog) - Collaborating workflows - Syncing (git remote) - [Overview](https://www.atlassian.com/git/tutorials/syncing) - [git fetch](https://www.atlassian.com/git/tutorials/syncing/git-fetch) - [git push](https://www.atlassian.com/git/tutorials/syncing/git-push) - [git pull](https://www.atlassian.com/git/tutorials/syncing/git-pull) - [Making a Pull Request](https://www.atlassian.com/git/tutorials/making-a-pull-request) - Using Branches (Git branch) - [Overview](https://www.atlassian.com/git/tutorials/using-branches) - [git checkout](https://www.atlassian.com/git/tutorials/using-branches/git-checkout) - [git merge](https://www.atlassian.com/git/tutorials/using-branches/git-merge) - [Merge conflicts](https://www.atlassian.com/git/tutorials/using-branches/merge-conflicts) - [Merge strategies](https://www.atlassian.com/git/tutorials/using-branches/merge-strategy) - Comparing Workflows - [Overview](https://www.atlassian.com/git/tutorials/comparing-workflows) - [Feature Branch Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow) - [Gitflow Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) - [Forking Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow) - Migrating to Git - [SVN to Git - prepping for the migration](https://www.atlassian.com/git/tutorials/svn-to-git-prepping-your-team-migration) - Migrate to Git from SVN - [Overview](https://www.atlassian.com/git/tutorials/migrating-overview) - [Prepare](https://www.atlassian.com/git/tutorials/migrating-prepare) - [Convert](https://www.atlassian.com/git/tutorials/migrating-convert) - [Synchronize](https://www.atlassian.com/git/tutorials/migrating-synchronize) - [Share](https://www.atlassian.com/git/tutorials/migrating-share) - [Migrate](https://www.atlassian.com/git/tutorials/migrating-migrate) - [Perforce to Git - why to make the move](https://www.atlassian.com/git/tutorials/perforce-git) - [Migrating from Perforce to Git](https://www.atlassian.com/git/tutorials/perforce-git-migration) - [Working with Git and Perforce: integration workflow](https://www.atlassian.com/git/tutorials/git-p4) - [How to move a Git repository with history](https://www.atlassian.com/git/tutorials/git-move-repository) - Advanced Tips - [Overview](https://www.atlassian.com/git/tutorials/advanced-overview) - [Merging vs. Rebasing](https://www.atlassian.com/git/tutorials/merging-vs-rebasing) - [Reset, Checkout, and Revert](https://www.atlassian.com/git/tutorials/resetting-checking-out-and-reverting) - [Advanced Git log](https://www.atlassian.com/git/tutorials/git-log) - [Git Hooks](https://www.atlassian.com/git/tutorials/git-hooks) - [Refs and the Reflog](https://www.atlassian.com/git/tutorials/refs-and-the-reflog) - [Git submodules](https://www.atlassian.com/git/tutorials/git-submodule) - [Git subtree](https://www.atlassian.com/git/tutorials/git-subtree) - [Large repositories in Git](https://www.atlassian.com/git/tutorials/big-repositories) - [Git LFS](https://www.atlassian.com/git/tutorials/git-lfs) - [Git gc](https://www.atlassian.com/git/tutorials/git-gc) - [Git prune](https://www.atlassian.com/git/tutorials/git-prune) - [Git bash](https://www.atlassian.com/git/tutorials/git-bash) - [How to store dotfiles](https://www.atlassian.com/git/tutorials/dotfiles) - [Git cherry pick](https://www.atlassian.com/git/tutorials/cherry-pick) - [GitK](https://www.atlassian.com/git/tutorials/gitk) - [Git-show](https://www.atlassian.com/git/tutorials/git-show) - Articles - [Dealing with Maven dependencies when switching to Git](https://www.atlassian.com/git/articles/maven-dependencies-versions-merging) - [Pull request proficiency: Fetching abilities unlocked\!](https://www.atlassian.com/git/articles/pull-request-proficiency-fetching-abilities-unlocked) - [Git and project dependencies](https://www.atlassian.com/git/articles/git-and-project-dependencies) - [Git or SVN? How Nuance Healthcare Chose a Git Branching Model](https://www.atlassian.com/git/articles/git-or-svn-git-branching-model) - [Git Forks And Upstreams: How-to and a cool tip](https://www.atlassian.com/git/tutorials/git-forks-and-upstreams) - [Core concept, workflows and tips](https://www.atlassian.com/git/articles/core-concept-workflows-and-tips) # Git checkout This page is an examination of the `git checkout` command. It will cover usage examples and edge cases. In Git terms, a "checkout" is the act of switching between different versions of a target entity. The `git checkout` command operates upon three distinct entities: files, commits, and branches. In addition to the definition of "checkout" the phrase "checking out" is commonly used to imply the act of executing the `git checkout` command. In the [Undoing Changes](https://www.atlassian.com/git/tutorials/undoing-changes) topic, we saw how `git checkout` can be used to view old commits. The focus for the majority of this document will be checkout operations on branches. Checking out branches is similar to checking out old commits and files in that the working directory is updated to match the selected branch/revision; however, new changes are saved in the project history—that is, it’s not a read-only operation. ## Checking out branches The `git checkout` command lets you navigate between the branches created by `git branch`. Checking out a branch updates the files in the working directory to match the version stored in that branch, and it tells Git to record all new commits on that branch. Think of it as a way to select which line of development you’re working on. Having a dedicated branch for each new feature is a dramatic shift from a traditional SVN workflow. It makes it ridiculously easy to try new experiments without the fear of destroying existing functionality, and it makes it possible to work on many unrelated features at the same time. In addition, branches also facilitate several collaborative workflows. The `git checkout` command may occasionally be confused with `git clone`. The difference between the two commands is that clone works to fetch code from a remote repository, alternatively checkout works to switch between versions of code already on the local system. ## Usage: Existing branches Assuming the repo you're working in contains pre-existing branches, you can switch between these branches using `git checkout`. To find out what branches are available and what the current branch name is, execute `git branch`. ``` 1$> git branch 2main 3another_branch 4feature_inprogress_branch 5$> git checkout feature_inprogress_branch ``` The above example demonstrates how to view a list of available branches by executing the `git branch` command, and switch to a specified branch, in this case, the `feature_inprogress_branch`. ## New branches `Git checkout` works hand-in-hand with [git branch](https://www.atlassian.com/git/tutorials/using-branches). The `git branch` command can be used to create a new branch. When you want to start a new feature, you create a new branch off `main` using `git branch new_branch`. Once created you can then use `git checkout new_branch` to switch to that branch. Additionally, The `git checkout` command accepts a `-b` argument that acts as a convenience method which will create the new branch and immediately switch to it. You can work on multiple features in a single repository by switching between them with `git checkout`. ``` 1git checkout -b <new-branch> ``` The above example simultaneously creates and checks out `<new-branch>`. The `-b` option is a convenience flag that tells Git to run `git branch <new-branch>` before running `git checkout <new-branch>`. ``` 1git checkout -b <new-branch> <existing-branch> ``` By default `git checkout -b` will base the `new-branch` off the current `HEAD`. An optional additional branch parameter can be passed to `git checkout`. In the above example, `<existing-branch>` is passed which then bases `new-branch` off of `existing-branch` instead of the current `HEAD`. ## Switching branches Switching branches is a straightforward operation. Executing the following will point `HEAD` to the tip of `<branchname>.` ``` 1git checkout <branchname> ``` Git tracks a history of checkout operations in the reflog. You can execute `git reflog` to view the history. ## Git checkout a remote branch When collaborating with a team it is common to utilize remote repositories. These repositories may be hosted and shared or they may be another colleague's local copy. Each remote repository will contain its own set of branches. In order to checkout a remote branch you have to first fetch the contents of the branch. ``` 1git fetch --all ``` In modern versions of Git, you can then checkout the remote branch like a local branch. ``` 1git checkout <remotebranch> ``` Older versions of Git require the creation of a new branch based on the `remote`. ``` 1git checkout -b <remotebranch> origin/<remotebranch> ``` Additionally you can checkout a new local branch and reset it to the remote branches last commit. ``` 1git checkout -b <branchname> 2git reset --hard origin/<branchname> ``` ## Detached HEADS Now that we’ve seen the three main uses of `git checkout` on branches, it's important to discuss the `“detached HEAD”` state. Remember that the `HEAD` is Git’s way of referring to the current snapshot. Internally, the `git checkout` command simply updates the `HEAD` to point to either the specified branch or commit. When it points to a branch, Git doesn't complain, but when you check out a commit, it switches into a `“detached HEAD”` state. This is a warning telling you that everything you’re doing is “detached” from the rest of your project’s development. If you were to start developing a feature while in a detached `HEAD` state, there would be no branch allowing you to get back to it. When you inevitably check out another branch (e.g., to merge your feature in), there would be no way to reference your feature: ![Attached head vs detached head](https://dam-cdn.atl.orangelogic.com/AssetLink/b01na740f1la476ut2ss5x8pqx7ohq8f.svg) The point is, your development should always take place on a branch—never on a detached `HEAD`. This makes sure you always have a reference to your new commits. However, if you’re just looking at an old commit, it doesn’t really matter if you’re in a detached `HEAD` state or not. ## Summary This page focused on usage of the `git checkout` command when changing branches. In summation, `git checkout`, when used on branches, alters the target of the `HEAD` ref. It can be used to create branches, switch branches, and checkout remote branches. The `git checkout` command is an essential tool for standard Git operation. It is a counterpart to [git merge](https://www.atlassian.com/git/tutorials/using-branches/git-merge). The `git checkout` and `git merge` commands are critical tools to enabling [git workflows](https://www.atlassian.com/git/tutorials/comparing-workflows). ## Recommended for you ### Bitbucket blog [Learn more](https://www.atlassian.com/blog/bitbucket) ### DevOps learning path [Learn more](https://university.atlassian.com/student/activity/2483065-hello-and-welcome) ### Learn more about Git Find more Git guides and resources in this hub. [Read more](https://www.atlassian.com/git) - [Company](https://www.atlassian.com/company) - [Careers](https://www.atlassian.com/company/careers) - [Events](https://www.atlassian.com/company/events) - [Blogs](https://www.atlassian.com/blog) - [Investor Relations](https://investors.atlassian.com/) - [Atlassian Foundation](https://www.atlassianfoundation.org/) - [Press kit](https://www.atlassian.com/company/news/press-kit) - [Contact us](https://www.atlassian.com/company/contact) ## Products - [Rovo](https://www.atlassian.com/rovo) - [Jira](https://www.atlassian.com/software/jira) - [Jira Align](https://www.atlassian.com/software/jira/align) - [Jira Service Management](https://www.atlassian.com/software/jira/service-management) - [Confluence](https://www.atlassian.com/software/confluence) - [Loom](https://www.atlassian.com/software/loom) - [Trello](https://trello.com/home) - [Bitbucket](https://www.atlassian.com/software/bitbucket) - [See all products](https://www.atlassian.com/software) ## Resources - [Technical support](https://support.atlassian.com/) - [Purchasing & licensing](https://www.atlassian.com/licensing/purchase-licensing) - [Atlassian Community](https://community.atlassian.com/) - [Knowledge base](https://confluence.atlassian.com/kb) - [Marketplace](https://marketplace.atlassian.com/) - [My account](https://my.atlassian.com/products/index) - [Create support ticket](https://support.atlassian.com/contact/) ## Learn - [Partners](https://www.atlassian.com/partners) - [Training & certification](https://www.atlassian.com/university) - [Documentation](https://confluence.atlassian.com/display/ALLDOC/Atlassian+Documentation) - [Developer resources](https://www.atlassian.com/developers) - [Enterprise services](https://www.atlassian.com/enterprise/services) - [See all resources](https://www.atlassian.com/resources) Copyright © 2026 Atlassian - [Privacy policy](https://www.atlassian.com/legal/privacy-policy) - [Notice at Collection](https://www.atlassian.com/legal/privacy-policy#additional-disclosures-for-ca-residents) - [Terms](https://www.atlassian.com/legal/cloud-terms-of-service) - [Impressum](https://www.atlassian.com/legal/impressum) Language selector English ▾
Readable Markdown
This page is an examination of the `git checkout` command. It will cover usage examples and edge cases. In Git terms, a "checkout" is the act of switching between different versions of a target entity. The `git checkout` command operates upon three distinct entities: files, commits, and branches. In addition to the definition of "checkout" the phrase "checking out" is commonly used to imply the act of executing the `git checkout` command. In the [Undoing Changes](https://www.atlassian.com/git/tutorials/undoing-changes) topic, we saw how `git checkout` can be used to view old commits. The focus for the majority of this document will be checkout operations on branches. Checking out branches is similar to checking out old commits and files in that the working directory is updated to match the selected branch/revision; however, new changes are saved in the project history—that is, it’s not a read-only operation. Checking out branches The `git checkout` command lets you navigate between the branches created by `git branch`. Checking out a branch updates the files in the working directory to match the version stored in that branch, and it tells Git to record all new commits on that branch. Think of it as a way to select which line of development you’re working on. Having a dedicated branch for each new feature is a dramatic shift from a traditional SVN workflow. It makes it ridiculously easy to try new experiments without the fear of destroying existing functionality, and it makes it possible to work on many unrelated features at the same time. In addition, branches also facilitate several collaborative workflows. The `git checkout` command may occasionally be confused with `git clone`. The difference between the two commands is that clone works to fetch code from a remote repository, alternatively checkout works to switch between versions of code already on the local system. Usage: Existing branches Assuming the repo you're working in contains pre-existing branches, you can switch between these branches using `git checkout`. To find out what branches are available and what the current branch name is, execute `git branch`. ``` $> git branch main another_branch feature_inprogress_branch $> git checkout feature_inprogress_branch ``` The above example demonstrates how to view a list of available branches by executing the `git branch` command, and switch to a specified branch, in this case, the `feature_inprogress_branch`. New branches `Git checkout` works hand-in-hand with [git branch](https://www.atlassian.com/git/tutorials/using-branches). The `git branch` command can be used to create a new branch. When you want to start a new feature, you create a new branch off `main` using `git branch new_branch`. Once created you can then use `git checkout new_branch` to switch to that branch. Additionally, The `git checkout` command accepts a `-b` argument that acts as a convenience method which will create the new branch and immediately switch to it. You can work on multiple features in a single repository by switching between them with `git checkout`. ``` git checkout -b <new-branch> ``` The above example simultaneously creates and checks out `<new-branch>`. The `-b` option is a convenience flag that tells Git to run `git branch <new-branch>` before running `git checkout <new-branch>`. ``` git checkout -b <new-branch> <existing-branch> ``` By default `git checkout -b` will base the `new-branch` off the current `HEAD`. An optional additional branch parameter can be passed to `git checkout`. In the above example, `<existing-branch>` is passed which then bases `new-branch` off of `existing-branch` instead of the current `HEAD`. Switching branches Switching branches is a straightforward operation. Executing the following will point `HEAD` to the tip of `<branchname>.` ``` git checkout <branchname> ``` Git tracks a history of checkout operations in the reflog. You can execute `git reflog` to view the history. Git checkout a remote branch When collaborating with a team it is common to utilize remote repositories. These repositories may be hosted and shared or they may be another colleague's local copy. Each remote repository will contain its own set of branches. In order to checkout a remote branch you have to first fetch the contents of the branch. ``` git fetch --all ``` In modern versions of Git, you can then checkout the remote branch like a local branch. ``` git checkout <remotebranch> ``` Older versions of Git require the creation of a new branch based on the `remote`. ``` git checkout -b <remotebranch> origin/<remotebranch> ``` Additionally you can checkout a new local branch and reset it to the remote branches last commit. ``` git checkout -b <branchname> git reset --hard origin/<branchname> ``` Detached HEADS Now that we’ve seen the three main uses of `git checkout` on branches, it's important to discuss the `“detached HEAD”` state. Remember that the `HEAD` is Git’s way of referring to the current snapshot. Internally, the `git checkout` command simply updates the `HEAD` to point to either the specified branch or commit. When it points to a branch, Git doesn't complain, but when you check out a commit, it switches into a `“detached HEAD”` state. This is a warning telling you that everything you’re doing is “detached” from the rest of your project’s development. If you were to start developing a feature while in a detached `HEAD` state, there would be no branch allowing you to get back to it. When you inevitably check out another branch (e.g., to merge your feature in), there would be no way to reference your feature: ![Attached head vs detached head](https://dam-cdn.atl.orangelogic.com/AssetLink/b01na740f1la476ut2ss5x8pqx7ohq8f.svg) The point is, your development should always take place on a branch—never on a detached `HEAD`. This makes sure you always have a reference to your new commits. However, if you’re just looking at an old commit, it doesn’t really matter if you’re in a detached `HEAD` state or not. Summary This page focused on usage of the `git checkout` command when changing branches. In summation, `git checkout`, when used on branches, alters the target of the `HEAD` ref. It can be used to create branches, switch branches, and checkout remote branches. The `git checkout` command is an essential tool for standard Git operation. It is a counterpart to [git merge](https://www.atlassian.com/git/tutorials/using-branches/git-merge). The `git checkout` and `git merge` commands are critical tools to enabling [git workflows](https://www.atlassian.com/git/tutorials/comparing-workflows).
Shard44 (laksa)
Root Hash11161217235333269644
Unparsed URLcom,atlassian!www,/git/tutorials/using-branches/git-checkout s443