Introduction to Git & GitHub : Basics

Git and GitHub are important software development technologies for version control and collaboration.

Git allows developers to track code changes, whereas GitHub provides a platform for storing and sharing repositories, facilitating efficient and designed teamwork, code collaboration, and project management.

🌠Git

Think of Git as a magical time-travel tool for files ✨. It helps you keep track of changes in your documents, almost like tracking the edits in a shared storybook. You can see who did what and even go back in time to earlier versions.

Git is like teamwork magic, letting everyone work on the story and then putting it all together 🤝

Git is a version control system that allows you to track file changes and collaborate on files with numerous people. While it has a primary application in software development, it might get used to track changes to any variety of files.

🌠GitHub

GitHub is like a friendly neighborhood where you can store and work on your projects. 🏡👩‍💻 It's like a big library that helps people keep track of their work and collaborate. Plus, it's a great place for open-source projects to hang out. 🌐

It is a Microsoft subsidiary that provides all of Git's distributed version control and source code management (SCM) functionalities while also adding its own.

Let's get started with practicals:

⚒Set up Git on your system

Git is available for download from the official website at

https://git-scm.com/downloads

🕊Create your own free GitHub account

Go to web https://github.com/ and sign up.

Verify your Email ID and Fill in with basic details.

🕊Create a new GitHub repository and Clone it to your PC

  • login on GitHub

  • Click on New > Create a new repository

  • Created Repository

  • Create a file by following the way

  • Now I'm going to clone the repository in the path indicated below on my machine. You have the option to choose to customize the folder, before that Copy the URL

  • Open Git Bash

  • chosen path: /d/NewGitFolder (this folder NewGitFolder was already created on a Windows machine )

      cd /d/NewGitFolder
    

    copied Url paste in terminal to download remote repository :

    https://github.com/VyankateshwarTaikar/First-repo.git

      git clone https://github.com/VyankateshwarTaikar/First-repo.git
    
      cd First-repo/
    
      ls
    
      cat demo1.txt
    

    • Now, Not only create a new file inside the directory NewGitFolder with written content but also change the content of demo1.txt

      The new file is created successfully. check with git status

        git status
      

      The file is in an untracked section so moving to the staging area in the following way :

        git add demo2.txt
      

      By committing it, it will move to the local repository from the staging area.

        git commit -m "Second file is created"
      

Here, we will change the content of demo1.txt

Now, all the above changes are pushed to the remote repository.

git push origin main

As you can see above the successful files are pushed to the remote repository.

Check with GitHub

I hope you enjoy the blog post!

If you do, please show your support by giving it a like ❤, leaving a comment 💬, and spreading the word 📢 to your friends and colleagues 😊

1
Subscribe to my newsletter

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

Written by

Vyankateshwar Taikar
Vyankateshwar Taikar

Hi i am Vyankateshwar , I have a strong history of spearheading transformative projects that have a direct impact on an organization's bottom line as a DevOps Engineer with AWS DevOps tools implementations.