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
Aspect | Main Branch | Master Branch |
Role | Git is a distributed version control system | Traditional default branch representing stability. |
Migration Process | Renaming to Main may involve migrating and updating references | No renaming is required for the traditional term |
Development Workflow | Developers often work on feature branches and merge them into the Main | Developers often work on feature branches and merge them into the Master |
🚀Exploring the Distinction: Git vs. GitHub
Aspect | Git | GitHub |
Definition | Git is a distributed version control system | GitHub is a web-based platform for hosting and collaborating on Git repositories. |
Type | Software/tool installed on your computer | Online platform accessible via a web browser |
Ownership | Developed by Linus Torvalds | Owned by Microsoft |
Accessibility | Can be used offline and locally on your computer | Requires an internet connection and a GitHub account |
Functionality | Manages version history, branches, and commits for your code | Provides Git repository hosting, collaboration tools, issue tracking, and more |
Repositories | Can create and manage Git repositories on your local machine | Provides a platform for hosting and managing remote Git repositories |
Collaboration | Collaboration is primarily local or within a closed network | Facilitates collaboration among developers worldwide |
Security | Provides basic security features for your local repository | Offers additional security features like access control and authentication |
Documentation | Documentation is available offline and via terminal commands | Offers extensive online documentation and community support |
Pricing | Free and open-source | Offers both free and paid plans with additional features |
Popular Use Cases | Personal or small-team project management | Large-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
Log into GitHub: 🖥️🔐 Open your web browser, go to GitHub, and log in to your GitHub account if you're not already logged in.\
Go to Your Profile: 👤👉 Click on your profile picture or username in the upper-right corner of the GitHub homepage.
Access Your Repositories: 📂🔍 From the dropdown menu, select "Your repositories" to view your existing repositories.
Click on "New": ➕📝 On the right-hand side, you'll see a green button labeled "New." Click on it.
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.
Choose Visibility: 👁️🌐 Select whether you want your repository to be public (visible to anyone) or private (restricted to collaborators).
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.
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 😊
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.