How to Install and Move Local Files to GitHub
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
Download the latest Git application to your local machine.
Run the application.
You will see the screen above. Click on Next.
In the next step, you will see the components tab. Select the required checkboxes.
Click on Next until you see Install.
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
git init
git add .
git commit -m 'Made Changes'
git push origin master
You will be asked to log in when you push your changes for the first time.
Log in to your GitHub account in the browser, and click on โsign in with your browser.โ
Once logged in, your changes will be moved to GitHub.
Standard Git Commands ๐ค
git init
- Initializes your repositorygit add
- Adds files to your repositorygit status
- Shows the status of your repositorygit commit
- Commits your changes to the repositorygit push
- Pushes your changes to GitHub
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.