Introduction to Git & GitHub : Basics 2

Introduction to Git & GitHub : Basics 2

ยท

5 min read

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 ๐Ÿ˜Š

Did you find this article valuable?

Support Vyankateshwar Taikar's blog by becoming a sponsor. Any amount is appreciated!