- Git
Git is a free, open-source version control software.
- Then what is github?
Github is a git repository system where we host our files.
- Let's install git
All the installation process based on windows in this post
Go to https://git-scm.com/download/win
Download 64 or 32 bit version acording to your system.
And install them with default settings.
- Now open terminal in project folder on your IDE or in Windows Terminal
Powershell recommended
type:
git --version
If it shows something like this then all looks good
git version 2.31.1.windows.1
Now create a repository on GitHub
- Login into github or signup for first time
add
user name
and
git config --global user.name "your name"
git config --global user.email "youremail@example.com"
- Get back to github
click on plus icon top-right of page and hit on
New Repository
give it a name and click
Create Repository
Copy the repository path
- In terminal use these command:
First initialize git into project
git init
Check files are listed
git status
Commit the code files
git commit -m "initial commit"
Add files to main branch
git branch -M main
Now add your remote repository link
git remote add origin https://github.com/yourName/project-name.git
With this final command push your code form local repository to github
git push origin master