Git and GitHub: A Quick Reference #14
personalizedrefrigerator
started this conversation in
Today I Learn
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Git and GitHub
This document is intended for students who participated in the Packtober Rest event (in October) and want a quick reference on how to use
gitandGitHub.Moving an Existing Project to GitHub
Let's say we have an existing project called
foothat we want to upload to GitHub.To do this:
New, the button just to the right ofRepositoriesCreate repository(you may also want to choose a license)Ctrl+`)gityet,git init .in the project's root directorygit add .to add all files in the current directory (which is represented by.) togit.git commit -m "a description of the commit here". Note that-mstands for--message.Cloning an Existing Repository
First, let's get the repository's clone URL:

From here, the repository can be cloned either from a graphical frontend for
gitor from the command line:From the command line
To get a copy of a repository on your computer, we use the
git clonecommand!Git Bash.cdcommand changes the directory the terminal is in. Thelscommand lists the files in the current directory. Use these commands to move to the location you want to save the code from the repository.git clone <url>command, pasting the repository's clone URL copied above (on some terminals, paste isCtrl+Shift+V):You've cloned the repository!
From VSCode
File > New Windowfirst if you're currently in a project):open!Pushing Changes to GitHub
From VSCode
From the command line
git(letgitknow that files might have changed)Contributing to a Project
forkthe project).Contribute(be sure to commit and push first!)Git Resources
Beta Was this translation helpful? Give feedback.
All reactions