'Git and Github - II : Tutorial for Beginner
Get started with Git and Github
Install Git
- For Windows, Download git from here and install it on your device
- Browse to the official Git website here.
- Click the download link and allow the download to complete.
- Extract and Launch Git Installer.
- Leave the default, unless you have reason to change it until then, click Next.
- Once the installation is complete, Launch Git Bash, then click Finish.
- For Linus, Use code
$ sudo dnf install git-all
Initialize with credentials
- Make sure your git is installed properly. To do that check version
git --version #To check version of git installed
- Provide Credentials (name and email) to git
git config --global user.name "Your_username" git config --global user.email “Your_email” git config --global — list # To check the info you provided.
Start with Github
- Signup on github
- Create a repository
- Add repository name, description
- Choose public or private
- Tick to add readme, license and git ignore
- Click on create repository
Work on Github project
- Go to your project in github and click on the green code button
- Copy the link
- Go to your folder directory, right-click and select git bash here
- Clone your project with following code
git clone <<Project Link>>
- Make changes as required on the project
- After making changes follow following steps to add files
git add .
- OR
git add <filename> #for specific files to add
- Commit the changes with message
git commit -m "<message>"
- Push everything to github to respective branch
git push origin <branch name>
- Sometimes If you are not logged in on Github, login prompt can be shown to enter your credentials otherwise, you can go and check your repository page on GitHub it should look something like this which contains all your files.
Comments
Post a Comment