Introduction to Git & GitHub : Basics 2

let's update, Git & its importance

Git is a powerful version control system used in software development 🖥️. It allows multiple collaborators to work on a project simultaneously, keeping track of changes, and ensuring a seamless collaboration process.

Git helps prevent conflicts 🚫 by merging changes intelligently and provides a historical record 📆 of all modifications made to the codebase. It's vital for project management, code maintenance 🧹, and debugging 🐞.

Git's decentralized nature ensures data redundancy, reducing the risk of data loss 📉. In essence, Git simplifies teamwork, enhances code quality 🌟, and empowers developers to build and innovate efficiently 🚀.

For previous blogs about basics Click Here

🤔Sometimes you might have questions Are the main branch and master branch & Git and GitHub are same?

Now, we will learn more about it by comparing 🤩

Don't worry, Your doubts will be clear by the following differences 😉

🚀Exploring the Distinction: Main Branch vs. Master Branch

AspectMain BranchMaster Branch
RoleGit is a distributed version control systemTraditional default branch representing stability.
Migration ProcessRenaming to Main may involve migrating and updating referencesNo renaming is required for the traditional term
Development WorkflowDevelopers often work on feature branches and merge them into the MainDevelopers often work on feature branches and merge them into the Master

🚀Exploring the Distinction: Git vs. GitHub

AspectGitGitHub
DefinitionGit is a distributed version control systemGitHub is a web-based platform for hosting and collaborating on Git repositories.
TypeSoftware/tool installed on your computerOnline platform accessible via a web browser
OwnershipDeveloped by Linus TorvaldsOwned by Microsoft
AccessibilityCan be used offline and locally on your computerRequires an internet connection and a GitHub account
FunctionalityManages version history, branches, and commits for your codeProvides Git repository hosting, collaboration tools, issue tracking, and more
RepositoriesCan create and manage Git repositories on your local machineProvides a platform for hosting and managing remote Git repositories
CollaborationCollaboration is primarily local or within a closed networkFacilitates collaboration among developers worldwide
SecurityProvides basic security features for your local repositoryOffers additional security features like access control and authentication
DocumentationDocumentation is available offline and via terminal commandsOffers extensive online documentation and community support
PricingFree and open-sourceOffers both free and paid plans with additional features
Popular Use CasesPersonal or small-team project managementLarge-scale, open-source, and community-driven projects

🔏Private Repository on GitHub

Private repositories on GitHub are important because they allow individuals and businesses to securely store and collaborate on sensitive or proprietary projects.

They offer a protected space where only authorized users can access and contribute to code, documents, and data.

This is crucial for safeguarding intellectual property, confidential information, and work in progress, ensuring that valuable work remains hidden from public view until it's ready for sharing.

Private repositories provide a secure environment for development and collaboration, making them essential for protecting the privacy and integrity of digital projects.

🌱Create a fresh private repository on GitHub

  1. Log into GitHub: 🖥️🔐 Open your web browser, go to GitHub, and log in to your GitHub account if you're not already logged in.\

  2. Go to Your Profile: 👤👉 Click on your profile picture or username in the upper-right corner of the GitHub homepage.

  3. Access Your Repositories: 📂🔍 From the dropdown menu, select "Your repositories" to view your existing repositories.

  4. Click on "New": ➕📝 On the right-hand side, you'll see a green button labeled "New." Click on it.

  5. Repository Settings: ⚙️🛠️ You'll be taken to a page where you can configure your new repository. Here, you can set the repository name, description, visibility (public or private), and more.

  6. Choose Visibility: 👁️🌐 Select whether you want your repository to be public (visible to anyone) or private (restricted to collaborators).

  7. Initialize with a README: 📄✅ If you want to start with a README file (recommended for most projects), check the "Initialize this repository with a README" option.

  8. Create Repository: 🚀🔨 Finally, click the green "Create repository" button at the bottom. Your new GitHub repository is now created and ready for use!

That's it! You've successfully created a new private repository on GitHub. 🎉👏

🌠Setting up your Name and Mail to associate with your commits

Open a GitBash Terminal (as we set in previously)

👉Locate the Git Configuration Files

vim ~/.gitconfig

or

vim .git/config

👉Edit the Configuration File

[user]

email = your.email@example.com

name = Your Name

👉Save and Exit

for save & exit with changes:wq!

👉Verify the Changes

git config user.name

git config user.email

That's it! You've successfully Set up your name and mail for your commit 👏

Not only did we learn about the previous blog basics of Git and its GitHub but also created a new file in the local repository with commit and pushed it into a remote repository.

Now ,Check with commit as we setup the Name and Mail id .

You can check it out previously here for your help 👉 Click Here

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.