Information

Pull, push, and merge - Basics of Git

January 15, 2025
Kaleb Arora
Pull, push, and merge - Basics of Git

Pull, Push, And Merge - Basics Of Git

In the world of development, something you will likely come across is Git. Today, I hope to explain to you exactly what it is and how to deal with it.

Git

Git is a multi-platform file tracking system that tracks changes across files and across devices. It allows for collaboration between different developers across the world.

Git works by tracking every change made to your file in a .git folder. It uses that folder to record changes to your folder.

How to install Git

You can install git from the git-scm platform.

Once installed, check the version using the command git --version.

Git Setup

Start by setting

To setup git on a new branch, there are two main ways you usually would set it up.

Setup Without A Remote Repository

When setting up without a remote repository, simply run git init and it automatically sets up.

Setup With A Remote Repository.

If you use a remote repository such as Github or Gitlab, you would use a specific set of commands to enable it. To set it up, navigate into the directory you want your code to be in and use:

git init
git add .
git commit -m "Initial commit"
git remote add origin <REMOTE_URL>
git push -u origin master

Git Local

Git runs both locally and remotely for most development systems. Heres how you use it on your local device:

  1. Make changes to your code
  2. Run the command git add * to add all changes. If you only want to add certain changes, you can run git add filename to only add those changes you want.
  3. Run the command git commit -m "Information" to run the git command, replacing the information part with what you did during that commit.
  4. Run git push to push your commit to the remote branch.

Gitlab, Github, BitBucket

Currently, in terms of remote databases, there are three main contenders: Github, Gitlab, and BitBucket. Each one has its drawbacks and benefits:

Github

Github is one of the most widely used git systems. With extensive integrations, far support for apps, and social features, its a great option for most use cases.

Gitlab

Gitlab is a DevSecOps focused repository system that offers amazing options for your system. Its best for those who need security based systems for their code.

BitBucket

While inferior to both the options I mentioned before, BitBucket is popular for its integrations with Atlassian code and Jira. Its only reccomended if you use these products.

Comparison Table

FeaturesGitHubGitLabBitBucket
Code repository
Social features❓ Not as extensive as other platforms
DevOps❓ Not as extensive as other platforms❓ Not as extensive as other platforms
PM tool features
Bug/issue tracking
AI-powered assistant
Integrations✅ Extensive❓ Only for Atlassian products: Jira, Confluence, etc.
Advanced security
Open-source project support (for free)
Automation features via CI/CD workflows

Conclusion

In conclusion, Git is an amazing way to track files and collaborate with other developers. By understanding the basics of pull, push, and merge, you can effectively manage your codebase and streamline your development workflow. Whether you are working on a solo project or as part of a team, Git provides the tools you need to keep your work organized and efficient. With platforms like GitHub, GitLab, and BitBucket, you have a variety of options to choose from based on your specific needs and preferences. Embrace the power of Git and take your development skills to the next level.

0
0
0

Comments

Kaleb Arora

Kaleb Arora

Kaleb is a DevOps Consultant at Sahara Compute. With over 4 years of Computer Science experience, he is passionate about helping businesses optimize their infrastructure and improve their development workflows.

Related Articles

What Our Customers Say

R

Rustic Network

"

Cam and his efforts at Sahara Compute have not gone unnoticed. Providing stable infrastructure to one of our most used assets and responding to any feedback and/or concerns raised, I have no complaints about the quality of service and hardware at SC. Keep going strong!

"

December 2024

Read more reviews on:

Trustpilot

Trusted By

Rustic Network
Qarsan
worldatwarMC
Fruitcube
Arvensis
Rustic Network
Qarsan
worldatwarMC
Fruitcube
Arvensis
Rustic Network
Qarsan
worldatwarMC
Fruitcube
Arvensis
Rustic Network
Qarsan
worldatwarMC
Fruitcube
Arvensis
Rustic Network
Qarsan
worldatwarMC
Fruitcube
Arvensis
Rustic Network
Qarsan
worldatwarMC
Fruitcube
Arvensis
Rustic Network
Qarsan
worldatwarMC
Fruitcube
Arvensis
Rustic Network
Qarsan
worldatwarMC
Fruitcube
Arvensis

Start Building Your Next Big Thing

Join thousands of users who are already creating the future with Sahara. Get started today with a matching deposit of up to $100.

Powerful infrastructure, unbeatable pricing

24/7 expert technical support

No long-term contracts, pay as you go

Valid for new customers only. User will deposit up to $100 and receive a matching deposit. All sales are backed by our refund policy.

Ready to get started?

Choose an option below:

Create new account

Get $100 matching credit instantly

TB

"I have never had a bad experience with the company, and they have had some of the best prices in the industry for their VMs. Glad I ditched DigitalOcean to go to Sahara Compute."

- Sahara Compute User