General

What You Need to Know About Git Before Joining a Team

Mark Shenouda
5 min read
What You Need to Know About Git Before Joining a Team
This article was written over 18 months ago and may contain information that is out of date. Some content may still be relevant, but please refer to official documentation for the latest information.

Learning Git is no joke!

If you are a developer, and you work alone, or haven't gotten a chance to work an organized team, this article is for you!

When I joined This Dot Labs as a junior software developer, I encountered a ton of issues with Git in my first weeks.

In this quick blog, I'll share what I learned from my team with the hope that it will make your life easier when you join your own team, and start using Git collaboraboratively.

1. Pull Request (PR)

When you’re working as a developer on a big collaborative project, things get complicated. You're not only worried about making mistakes yourself, but you're hoping nobody else's bugs get merged into the shared code either. So how can a team of developers organize their work flow to better work together?

The generally accepted best practice is not pushing to the main branch at all. Instead, separate the work into small pieces. Each piece is a new feature in the project, and developers code each feature on a separate branch. Then, they open a pull request, and that means they want to merge their changes with the main branch!

Next, your pull request will be reviewed by team leads, tested, and hopefully approved.

If you receive that approval, congratulations! You can merge your branch into main branch now. 🥳

2. Husky

This is a tool that we use to run scripts and tests before we commit, or push changes to get high-quality commits! For more information, visit https://typicode.github.io/husky.

3. Rebase

This was the most difficult topic for me to grasp in the first two weeks, but I finally got it! I will simplify it with graphs to make it easier to understand.

Imagine we are working on a project, and we have three commits: m1, m2, and m3:

Git rebase explanation 1

If you had to write code for a new feature in the project, you would have to create a new branch, like this:

Git rebase explanation 2

Now, the feature branch is based on the last commit of the main branch, which is m3.

After ceating this branch, you might add some commits, which are represented by f1, f2, and f3:

Git rebase explanation 3

But while you're coding, one of your teammates could add some commits to the main branch, and now the main branch looks like this:

Git rebase explanation 4

If this happens, your branch is behind the main, so you need to rebase it to the latest version of the main to see these changes with the next command.

git rebase main

And this is how your feature branch looks now:

Git rebase explanation 5

Now, as you can see, the rebase process pushes your commits forward, so your branch is based on m5 instead of m3, and you have the latest version of the changes.

And if you open the git log, the commits in your feature branch will look like this:

Git rebase explanation 6

4. Git fetch vs pull

This also confused me at the beginning, but let’s simplify it! If you haven't worked on a team yet, you've probably only used Git push and pull commands because you’re the only developer on the project!

git fetch is the command that tells your local git to retrieve the latest meta-data info from the original (Though it doesn’t do any file transferring. It’s sort of "checking" to see if there are any changes available).

git pull on the other hand does that AND brings (copies) those changes from the remote repository.

So to summarize this, git pull does a git fetch, followed by a git merge.

5. Git strategy (Rebase vs Merge)

There are a lot of ways to use Git, and I see a different method in each project I work on. But, these are the two patterns I saw most frequently.

Merge Strategy

Imagine you’re working on a website, and the client wants you to add a new "About" page.

Using this strategy, you’ll make a new branch for the new page. Then, you will divide this page into smaller pieces/components, and make a new branch from the main feature branch (the About page branch) for each one. After this, you will merge these smaller branches into the feature branch, and when the "About" branch components are ready, you can merge the About branch into the main branch.

Git merge strategy example

Pros of this strategy:

It’s safe, and protects everyone’s work!

Cons of this strategy:

As you can see from the image above, the branches can get complicated!

Rebase Strategy

To avoid some complexities in the Merge strategy, especially in very large projects that may contain thousands of branches, you can rebase your commits.

A rebase takes your commits, and reapplies them with a new position. You are essentially moving your starting point.

After rebasing a commit, it will look like the code from a single straightforward line, like this:

Git rebase strategy example

Pros of this strategy:

The main branch will look like the code from in a single straightforward line!

Cons of this strategy:

Rebasing does have its risks, and can result in you losing your work.

Final thoughs: Every Git strategy has pros and cons, and so much of the strategizing process will depend on team preference. I bring up these two options as they are the most common you will encounter when you begin working on collaborative projects with Git.

About the author

Mark Shenouda

Mark Shenouda

Software Engineer

Keep reading

View all posts →

"How do I undo my most recent commit?" - Mastering the git reset command

Ever messed up a commit? Learn how to undo it like a pro! Our new blog post breaks down the git reset command, helping you navigate those "oops" moments with confidence....

Mattia Magi2 mins
Git

Ensuring Accurate Workflow Status in GitHub for Enhanced Visibility

Master the nuances of GitHub workflows with our latest blog post. Discover key strategies to ensure your workflows accurately reflect the true status of tests and tasks, preventing misleading green checks. ...

William Mimura3 mins
GitHubGit

Mastering Git Rerere: Solving Repetitive Merge Conflicts with Ease

Are you curious to discover one of the hidden powers of Git? Incorporate git rerere into your Git workflow, and say goodbye to the frustration of repetitive merge conflicts....

Mattia Magi4 mins
Git

Effective Communication Strategies Within The Software Development Organization

Have you ever been in a situation where you thought you were communicating effectively, only to realize later that the other person misunderstood what you were saying? Have you ever communicated with someone only to hear that they felt you provided way too much detail, or that you didn’t provide nearly enough detail? Communication in the workplace is how ideas, updates, directions, etc are transferred to others. Each party in a software development organization has differing needs and expectations when it comes to workplace communication. By learning to tailor your communication to meet the needs of each stakeholder, you can become a more effective communicator and achieve greater success within your organization. The requirements of various parties that you interact with in the workplace can vary wildly depending on several factors. Your awareness of these individualized communication preferences and how you can give each party what they want and need will impact your effectiveness in your daily activities, your perception by others, and even your upward mobility within the organization. That's the power of communication, and why it's so important to master effective communication strategies in the workplace! In this article, we'll explore the different types of stakeholders in a software development organization, the communication strategies that work best for each group, and how effective communication can help you advance your career in the industry. We'll start by discussing the difference between “communication” and “effective communication”, before diving into the different types of stakeholders in a software development organization. Then, we'll explore the communication strategies that work best for each group, and provide actionable tips for improving your communication skills. Communication vs. Effective Communication When it comes to communication, it's important to remember that the intended message is only effective if it's received and understood by the recipient, regardless of their background or level of familiarity with the topic. Effective communication is about sharing thoughts, ideas, opinions, knowledge, and data in a way that ensures that the message is received and understood by the recipient. With effective communication, the sender and receiver leave the exchange feeling satisfied. There is a shared understanding of what was intended to be transmitted by the sender. Stakeholder Types In any organization, you have many different types of parties involved in a software project. Let's group the parties involved in software development into three categories for the sake of clarity: Development Team This consists of individual contributors, project managers, scrum masters, QA testers, UX designers, UI designers, architects, etc. Product Team The product team is made up of a diverse group of individuals, including product owners, business analysts, architects, and more. Executive Team CTO, CEO, etc. Each of these parties requires a different type of communication, a different level, and has different needs from your interactions to allow you to provide value from what you are saying and to for them view you as an effective communicator. Let’s talk a bit about what each of these parties needs, and how you can interact with them in the most meaningful way possible. Development Team This is the most detailed version of the interaction. This group needs to be communicated with on the level of individual tickets and the details of those tickets. When interacting with the development team, it's important to focus on the nitty gritty details of each task, ensuring that everything is sorted through meticulously. With this group, we will sort through specific implementation details. An example of interaction with someone from this group might look like this, “I am currently working on ticket 473, and trying to get the checkbox to behave correctly during testing. I have no blockers currently.” Product Team This group will be communicated with at the level of features and larger increments of work such as project milestones. This group is interested in chunks of a project, milestones, progress on the overall initiative, etc. An example of interaction with someone from this group might look like this, “The team is wrapping up development of the new Project X User Interface and will be moving to the implementation of the functionality next”. Executive Team This group is interested in the conversation at the highest levels of abstraction. Generally, they will be more concerned with things at the overall project level. When updating the executive team, it's important to provide high level updates that summarize progress and focus on next steps. For example, you might say, 'We're making great progress on Showcase X and are on track to complete it soon. Next, we'll be shifting our attention to project Y.' Types of Communication What are some of the types of communication? It’s a great question. When you begin to study various communication styles, you will read about different personality types, and how those personalities interact with the world around them. You might hear things like aggressive, passive aggressive, passive, and assertive communication styles. While understanding these can help you communicate effectively, we will focus on how different roles in a company require different levels of detail and specificity in their interactions. Your Natural Communication Style We all have a natural way that we prefer to communicate. Some are very direct and assertive. We might tend to be very to the point, with no filler, no fluff. Others might naturally tend to be more verbose, to fill in lots of details and context and information. Some naturally meet somewhere in the middle on the spectrum of detail vs direct higher level type of communication. There is no right or wrong answer, but you must be aware of your natural tendencies in conversation, and know how to use those effectively, or tailor your communication style to a specific situation or audience. Benefits of Tailored Communication What are the benefits of tailored communication? The primary benefits of tailoring your communication to different stakeholders are that you can provide each person with what they want and need in a way that resonates with them. For instance, I once had to adapt my communication style when working with a highly detail oriented developer who preferred a more granular level of communication. This eases the amount of effort required by the other party to understand you, and allows them to be more effective in taking your message forward. It increases the perception of your effectiveness, and credibility in their eyes as well. If people know that you are someone who can communicate with multiple parties with varying interests and needs, and do so effectively, you will be trusted with more responsibility, and be given more opportunities. Using Effective Communication To Advance Your Career As you can see, developing effective communication skills is a powerful way to advance your career in the software development industry. How have you seen effective communication impact your work? People who are seen as effective communicators have staying power in an organization. They are viewed as competent and necessary. They are given positions of authority and trusted to get things done. I remember that, when I was just starting out in software development, I struggled to communicate effectively with stakeholders at different levels of the organization. But over time, I learned the value of tailoring my communication to each person's unique needs, and it has paid off in my career in countless ways. Basic Strategies For Improving Your Communication Know your audience When preparing for a presentation or conversation, it's essential to consider your audience and tailor your communication style to their needs. What are some strategies you use to ensure your message is received and understood? Write notes in advance, when possible Draw an outline or even the bulk of what you need to deliver before the time comes. Even if you don’t ultimately use these notes directly, preparing them will help you to distill your thoughts and clarify your message, as well as review that they have the appropriate amount of detail for the intended audience. Practice your delivery Though you will not always be giving a speech, talking through what you plan to say will help you to see gaps, smooth the flow, and make sure that you are comfortable with the material you will be presenting or communicating. Conclusion In this article, we learned about the importance of effective communication, strategies for improving your communication, and the direct and indirect positive impacts these improvements can have on your effectiveness and value in the organization. We explored various strategies and approaches to improve communication. Development in this area can yield amazing results for you as you make the investment to improve your skills. We hope you enjoyed this article, and found it helpful. If you have any questions please feel free to join the discussions going on at starter.dev or on our Discord....

Ken Slachta6 mins
GeneralSoftware Engineer