How to upload a project to a GitHub repository


If you are a novice in the world of development, you may not know That upload a project to GitHub, a portal created so that any developer can host the code of their applications, programs or tools in a repository so that other members of the community can download it and even collaborate to improve it and create branches from it.

How to create a repository on GitHub:

With an account on this platform, whose registration is free of charge, you can upload files to GitHub. To do this, create a repository on GitHub to host by following these steps:

  1. Use the drop-down menu in the upper right corner of any page and select New repository.

  2. Enter a name for the repository. You can also add a description to it.

  3. Choose repository visibility: public, internal or private.

  4. Choose Initialize this repository with a README file, which will contain project information and can be edited at any time.

  5. Click on Create repository.

How to upload a project's code to the GitHub repository:

At the bottom of the repository the contents of the README will be displayed (it is convenient to create it and give it the appropriate styles), as well as instructions on how the program works, application or tool and how to launch it.

To upload a previously created code, do the following:

1. Open the terminal in the folder where the source files are stored and type the following code to get started git in that folder:

2. The folder has been created.git with project information. Add the files to upload with this command:

Another way to add a single file is by entering the following command:

git add file name

3. Prepare the files you want to upload with a brief explanation of the changes:

git commit -m “Initial project created”

4. You must upload the changes to GitHub. For this you must know the path of the repository (ending in.git) which is in Clone O Descargar, the green button on the project page. Then add the repository from the terminal with this command:

git remote add origin URLrepository.git

5. load the changes with the following command:

git Push origin Maestro

If you have followed these steps, the changes will appear on the project page, It's easy, truth?

How to upload an on-premises project to GitHub from Visual Studio Code:

Microsoft had the great idea of integrating GitHub into its development environment so that developers could upload their projects seamlessly from Visual Studio.. Code. To do this you must do the following:

  1. Connect to GitHub from Visual Studio Code going to the section Team Explorer, then click on Connection Manager and later in Sign in.

  2. Enter your GitHub username and password.

  3. If you haven't done it before, create a repository for your workspace as you previously saw.

  4. Add your project by double-clicking the repository.

  5. Copy the project response to the workspace path.

  6. Click on Changes and you will see a list showing the files to be included in the repository.

  7. Add a description about the changes and click Commit All.

  8. Sync changes with GitHub to upload files to that platform by clicking Sync up when the confirmation message of Commit.

  9. Press the button Push to start the procedure and you will see a message confirming the publication of the project in the repository.

  10. Log in to the GitHub web portal and log in to your account to check if the project has been successfully uploaded.

If you have followed these steps, your project will have successfully uploaded to GitHub.

Easy right??

Subscribe to our Newsletter

We will not send you SPAM mail. We hate it as much as you.