✅ Cómo SUBIR un Proyecto Local a Github desde Visual Studio Code en menos de 6 minutos!
How to Upload a Local Project to GitHub Using Visual Studio Code
Initial Setup and Installation
- The video begins by acknowledging the existence of many tutorials on uploading projects to GitHub but aims to provide a straightforward method using Visual Studio Code.
- It emphasizes the necessity of having both Visual Studio Code and Git installed on your operating system, recommending the installation of the system version rather than the user version.
- After installing Visual Studio Code, users are instructed to check if Git is functioning by attempting to execute a command in the terminal; if unsuccessful, they need to download and install Git.
Creating a New Repository
- Once both programs are installed, users can open their project folder in Visual Studio Code or create a new one for demonstration purposes.
- The first command executed in the terminal is
git init, which initializes a new local repository and creates a hidden.gitdirectory within the project folder.
- Following this, users run
git add .to stage all new, modified, or deleted files for commit.
Configuring User Information
- Users must configure their name and email address for commits using specific commands; this information will be included with each future commit.
- After setting up user details, executing
git commit -m "message"confirms that staged files are ready for upload.
Pushing Changes to Remote Repository
- To upload changes to GitHub, users run
git push, but an error may occur due to not defining a remote repository yet.
- Users are guided through creating a remote repository on GitHub by clicking "Create New Repository," naming it, and choosing its visibility (public/private).
Linking Local Repository with Remote Repository
- After creating the remote repository, users copy its link and use
git remote add origin <link>in the terminal to link it with their local project.
- The term "origin" serves as an alias for referencing the remote repository URL; however, any preferred name can be used instead.
Finalizing Push Command Configuration
- On attempting another push with
git push, an error may arise indicating that it's necessary first to set upstream tracking between local and remote branches usinggit branch --set-upstream-to origin master.
- This step establishes explicit relationships between local and remote branches during initial pushes only.
Simplifying Future Commits