Skip to content

Instantly share code, notes, and snippets.

@dovakeen118
Last active September 26, 2023 21:40
Show Gist options
  • Save dovakeen118/7ead8acb79e03a7494ef53c1026e8814 to your computer and use it in GitHub Desktop.
Save dovakeen118/7ead8acb79e03a7494ef53c1026e8814 to your computer and use it in GitHub Desktop.

Sharing Single Files

The easiest way to share a single file or small number of files is to send them over Slack. We recommend you do so using Slacks snippets. You can create a new snippet by typing /snippet in the chat text box. This will open a new window where you can paste the contents of your file to share.

Copy and Pasting text from Slack not in a snippet might behave unexpectedly in VSCode. Copying general text from Slack, particularly quotations, will likely not be interpretted correctly by VSCode. Slack uses "special" quotations that appear italicized, whereas the quotations used by VSCode are vertical. See the block below for an example:

“banana” // from Slack
"banana" // from VSCode

Downloading Files from a VSCode Live Share Session

  1. Both partners download VSCode extension: LiveShare
  2. From the VSCode text editor with the project open, you should see a tab Visual Studio Live Share (Workspace)
  3. Inside this tab, you should see the folder for the project you are collaborating on. From the example image below the project is person-constructor
  4. Right click the folder name

image

  1. There will be an option to Download
  2. Select where you want to save the project on your machine!

Note: After you download the file, any new changes to the original will not be reflected in your downloaded copy

Sharing a GitHub Repository

You will need the article Git Basics

As the person with the code to share, follow steps under How to Add Git to Your App/Directory. Once the repo has been created, share the link to the repo with your partner.

As the person receiving the repo link:

  1. Navigate in the terminal to the folder where you want this codebase to live (such as challenges)
  2. If using challenges, make sure you do not already have a directory with the same name as the repo your partner sent you, otherwise it will overwrite your original work! When this is the case, you can rename the folder you already have.
  3. Run the command git clone <url-to-repo> to create a new directory for the codebase shared
  4. cd <name-of-repo> to interact with the codebase

If new changes are made to the codebase after you cloned, the person with the changes will need to make a commit and push the changes to the repo on GitHub. Once the new changes are pushed to GitHub, the other partner can run git pull origin main to bring in the new changes to the codebase on their machine.

General Tips on Git:

  • You will not need to use Git until Project weeks
  • You likely will not need to learn about or use branching until Project weeks
  • You can follow these same steps on how to clone a repo if you want to use a codebase shared from a facilitation or clinic
  • Let us know if you have any questions and we're happy to help!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment