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 ๐