How to Install and Move Local Files to GitHub

Computer GarageComputer Garage
2 min read

Introduction ๐Ÿ“–

Git is a free, open-source version control system known for its speed and efficiency. Projects of all sizes use GitHub. You can even use Git on your local machine to track your software code without needing to connect to GitHub.

Git - Downloads Git is available for Windows, Mac, and Linux operating systems. It offers both Command-Line and GUI options for users, with the Command-Line being the most preferred.

Installing Git on Windows

  1. Download the latest Git application to your local machine.

  2. Run the application.

  3. You will see the screen above. Click on Next.

  4. In the next step, you will see the components tab. Select the required checkboxes.

  5. Click on Next until you see Install.

  6. Click Install, wait for a while, and then click Close.

Now Git is installed on your system. To check if Git is working:

  • Go to your Desktop.

  • Right-click and select "Git Bash Here."

  • Type the following command and press Enter: git --version

  • If it doesn't work, Git was not installed correctly.

Moving Your Local Repository to GitHub

Open your GitHub account and create a new repository.

Once your local code is ready to move to GitHub, go to the folder where your code is.

Right-click and select Git Bash Here.

Type the following commands and press Enter after each one

  1. git init

  2. git add .

  3. git commit -m 'Made Changes'

  4. git push origin master

  5. You will be asked to log in when you push your changes for the first time.

  6. Log in to your GitHub account in the browser, and click on โ€œsign in with your browser.โ€

  7. Once logged in, your changes will be moved to GitHub.

Standard Git Commands ๐Ÿ”ค

  • git init - Initializes your repository

  • git add - Adds files to your repository

  • git status - Shows the status of your repository

  • git commit - Commits your changes to the repository

  • git push - Pushes your changes to GitHub

0
Subscribe to my newsletter

Read articles from Computer Garage directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Computer Garage
Computer Garage

I'm a full stack web developer at a MNC Company. Majorly working with Angular and AWS. I love to learn new tech and trying over it.