From 574449822910daf040a8a91e8bb54a414596e9b7 Mon Sep 17 00:00:00 2001 From: Christian Alfoni Date: Fri, 8 Mar 2024 11:28:49 +0000 Subject: [PATCH 1/6] feat: Add information on using terminal with Git on CodeSandbox for branch navigation and updating --- .../repositories/getting-started/git-workflow.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx b/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx index 11da05ef..f0e0d3fc 100644 --- a/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx +++ b/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx @@ -8,6 +8,16 @@ import { Callout } from 'nextra-theme-docs' # Git workflow +## Terminal + +Working locally you where likely using the terminal to interact with Git. You can still use your terminal, with one exception: `git checkout`. + +Since each branch on CodeSandbox is its own MicroVM and environment, we will rather navigate you to the respective MicroVM when doing a `git checkout`. Normally this is just another way of navigating to a branch, but if you +use `git checkout` related to updating your branch from your target, you will need to conform to the following: + +- If you use `rebase` you should use the following command: `git rebase origin/main my-current-branch`. This is [a more efficient way](https://stackoverflow.com/a/56840200) and bypasses the need for a checkout +- If you use `merge` you should use the upper left pill which appears automatically when you are behind your target + ## Git panel After you have made some changes to your code and saved them (⌘ + S or Ctrl + S), you will notice a purple notification next to the git icon at the top of the left sidebar. From 0f81ad5d9094e13f6601dad9c31504fa56bd0aee Mon Sep 17 00:00:00 2001 From: Christian Alfoni Date: Thu, 14 Mar 2024 12:59:51 +0100 Subject: [PATCH 2/6] Update packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx Co-authored-by: Necoline Hubner --- .../pages/learn/repositories/getting-started/git-workflow.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx b/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx index f0e0d3fc..f5a4c59d 100644 --- a/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx +++ b/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx @@ -10,7 +10,8 @@ import { Callout } from 'nextra-theme-docs' ## Terminal -Working locally you where likely using the terminal to interact with Git. You can still use your terminal, with one exception: `git checkout`. +When working locally, you likely use the terminal to interact with Git. On CodeSandbox, Git commands will work as expected with one exception: `git checkout`. + Since each branch on CodeSandbox is its own MicroVM and environment, we will rather navigate you to the respective MicroVM when doing a `git checkout`. Normally this is just another way of navigating to a branch, but if you use `git checkout` related to updating your branch from your target, you will need to conform to the following: From a28ae57d0773865de58d39d84c147c8b7dff9077 Mon Sep 17 00:00:00 2001 From: Christian Alfoni Date: Thu, 14 Mar 2024 13:00:02 +0100 Subject: [PATCH 3/6] Update packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx Co-authored-by: Necoline Hubner --- .../learn/repositories/getting-started/git-workflow.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx b/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx index f5a4c59d..dac5a2e7 100644 --- a/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx +++ b/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx @@ -13,7 +13,10 @@ import { Callout } from 'nextra-theme-docs' When working locally, you likely use the terminal to interact with Git. On CodeSandbox, Git commands will work as expected with one exception: `git checkout`. -Since each branch on CodeSandbox is its own MicroVM and environment, we will rather navigate you to the respective MicroVM when doing a `git checkout`. Normally this is just another way of navigating to a branch, but if you +Each branch runs on its own virtual machine (VM). So instead of checking out a branch within the same VM, when you change a branch on CodeSandbox, we will navigate you to the branch running on its respective VM. + +However, if you choose to change branch from the terminal using `git checkout`, you will need to conform to the following + use `git checkout` related to updating your branch from your target, you will need to conform to the following: - If you use `rebase` you should use the following command: `git rebase origin/main my-current-branch`. This is [a more efficient way](https://stackoverflow.com/a/56840200) and bypasses the need for a checkout From ea8523d804ce203906bb6fdfd140a961afdf1f05 Mon Sep 17 00:00:00 2001 From: Christian Alfoni Date: Thu, 14 Mar 2024 13:00:50 +0100 Subject: [PATCH 4/6] Update packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx Co-authored-by: Necoline Hubner --- .../pages/learn/repositories/getting-started/git-workflow.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx b/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx index dac5a2e7..56c94187 100644 --- a/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx +++ b/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx @@ -17,7 +17,6 @@ Each branch runs on its own virtual machine (VM). So instead of checking out a b However, if you choose to change branch from the terminal using `git checkout`, you will need to conform to the following -use `git checkout` related to updating your branch from your target, you will need to conform to the following: - If you use `rebase` you should use the following command: `git rebase origin/main my-current-branch`. This is [a more efficient way](https://stackoverflow.com/a/56840200) and bypasses the need for a checkout - If you use `merge` you should use the upper left pill which appears automatically when you are behind your target From 72cb563c82bb6f297c685b911b1acdc6cf83aa52 Mon Sep 17 00:00:00 2001 From: Christian Alfoni Date: Thu, 14 Mar 2024 12:11:17 +0000 Subject: [PATCH 5/6] updates to text --- .../learn/repositories/getting-started/git-workflow.mdx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx b/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx index dac5a2e7..00a435de 100644 --- a/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx +++ b/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx @@ -15,12 +15,10 @@ When working locally, you likely use the terminal to interact with Git. On CodeS Each branch runs on its own virtual machine (VM). So instead of checking out a branch within the same VM, when you change a branch on CodeSandbox, we will navigate you to the branch running on its respective VM. -However, if you choose to change branch from the terminal using `git checkout`, you will need to conform to the following +However, if you currently use `git checkout` to update your branch from target, you will need to conform to the following: -use `git checkout` related to updating your branch from your target, you will need to conform to the following: - -- If you use `rebase` you should use the following command: `git rebase origin/main my-current-branch`. This is [a more efficient way](https://stackoverflow.com/a/56840200) and bypasses the need for a checkout -- If you use `merge` you should use the upper left pill which appears automatically when you are behind your target +- If you use `checkout` with `rebase` you should use the following command instead: `git rebase origin/main my-current-branch`. This is [a more efficient way](https://stackoverflow.com/a/56840200) and bypasses the need for a checkout +- If you use `merge` you should use the upper left pill in the UI which appears automatically when you are behind your target ## Git panel From 4e9fe22e2349a88d057f7a5963afea656964a485 Mon Sep 17 00:00:00 2001 From: Christian Alfoni Date: Fri, 15 Mar 2024 08:39:31 +0000 Subject: [PATCH 6/6] rename docs --- .../learn/repositories/getting-started/git-workflow.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx b/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx index 00a435de..31c21e23 100644 --- a/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx +++ b/packages/projects-docs/pages/learn/repositories/getting-started/git-workflow.mdx @@ -10,16 +10,17 @@ import { Callout } from 'nextra-theme-docs' ## Terminal -When working locally, you likely use the terminal to interact with Git. On CodeSandbox, Git commands will work as expected with one exception: `git checkout`. +When working locally, you likely use the terminal to interact with Git. On CodeSandbox, Git commands will work as expected with two exceptions, changing and renaming the branch. - -Each branch runs on its own virtual machine (VM). So instead of checking out a branch within the same VM, when you change a branch on CodeSandbox, we will navigate you to the branch running on its respective VM. +Each branch runs on its own virtual machine (VM). So instead of checking out a branch within the same VM, when you change a branch on CodeSandbox, we will navigate you to the branch running on its respective VM. However, if you currently use `git checkout` to update your branch from target, you will need to conform to the following: - If you use `checkout` with `rebase` you should use the following command instead: `git rebase origin/main my-current-branch`. This is [a more efficient way](https://stackoverflow.com/a/56840200) and bypasses the need for a checkout - If you use `merge` you should use the upper left pill in the UI which appears automatically when you are behind your target +If you need to rename the branch, please double click the name in the topbar and change it there. + ## Git panel After you have made some changes to your code and saved them (⌘ + S or Ctrl + S), you will notice a purple notification next to the git icon at the top of the left sidebar.