Git Submodules Explained: Tutorial | Example | Guide | GitHub | Update | GitModules

Git Submodules allow you to keep a Git repository as a subdirectory of another Git repository (Git Submodules Explained). This lets you clone another repository into your project and keep your commits separate. Let’s get started by creating two github repositories. Let’s use module-a name for the main project and module-b for the git submodule.

Did I help you out?
☕ Buy Me a Coffe: https://www.buymeacoffee.com/antonputra
🔴 Add me on LinkedIn: https://www.linkedin.com/in/anton-putra

=========
⏱️TIMESTAMPS⏱️
0:00 Intro
0:10 Starting with Submodules
1:35 Cloning a Project with Submodules
2:36 Pulling Upstream Changes from the Project Remote
4:20 Working on a Submodule
5:26 Publishing Submodule Changes

=========
Source Code
🖥️ - GitHub: https://github.com/antonputra/tutorials/tree/main/lessons/068

=========
SOCIAL
🎙 - Twitter: https://twitter.com/antonvputra
📨 - Email: [email protected]

#Git #GitSubmodules #GitModules

#gitmodules #gitsubmodules #git

Git Submodules Explained: Tutorial | Example | Guide | GitHub | Update | GitModules

Git Submodules Explained: Tutorial | Example | Guide | GitHub | Update | GitModules

Git Submodules allow you to keep a Git repository as a subdirectory of another Git repository (Git Submodules Explained). This lets you clone another repository into your project and keep your commits separate. Let’s get started by creating two github repositories. Let’s use module-a name for the main project and module-b for the git submodule.

Did I help you out?
☕ Buy Me a Coffe: https://www.buymeacoffee.com/antonputra
🔴 Add me on LinkedIn: https://www.linkedin.com/in/anton-putra

=========
⏱️TIMESTAMPS⏱️
0:00 Intro
0:10 Starting with Submodules
1:35 Cloning a Project with Submodules
2:36 Pulling Upstream Changes from the Project Remote
4:20 Working on a Submodule
5:26 Publishing Submodule Changes

=========
Source Code
🖥️ - GitHub: https://github.com/antonputra/tutorials/tree/main/lessons/068

=========
SOCIAL
🎙 - Twitter: https://twitter.com/antonvputra
📨 - Email: [email protected]

#Git #GitSubmodules #GitModules

#gitmodules #gitsubmodules #git

Git Submodules Explained: Tutorial | Example | Guide | GitHub | Update | GitModules

7 Best Practices in GIT for Your Code Quality

There is no doubt that Git plays a significant role in software development. It allows developers to work on the same code base at the same time. Still, developers struggle for code quality. Why? They fail to follow git best practices. In this post, I will explain seven core best practices of Git and a Bonus Section.

1. Atomic Commit

Committing something to Git means that you have changed your code and want to save these changes as a new trusted version.

Version control systems will not limit you in how you commit your code.

  • You can commit 1000 changes in one single commit.
  • Commit all the dll and other dependencies
  • Or you can check in broken code to your repository.

But is it good? Not quite.

Because you are compromising code quality, and it will take more time to review codeSo overall, team productivity will be reduced. The best practice is to make an atomic commit.

When you do an atomic commit, you’re committing only one change. It might be across multiple files, but it’s one single change.

2. Clarity About What You Can (& Can’t) Commit

Many developers make some changes, then commit, then push. And I have seen many repositories with unwanted files like dll, pdf, etc.

You can ask two questions to yourself, before check-in your code into the repository

  1. Are you suppose to check-in all these files?
  2. Are they part of your source code?

You can simply use the .gitignore file to avoid unwanted files in the repository. If you are working on more then one repo, it’s easy to use a global .gitignore file (without adding or pushing). And .gitignore file adds clarity and helps you to keep your code clean. What you can commit, and it will automatically ignore the unwanted files like autogenerated files like .dll and .class, etc.

#git basics #git command #git ignore #git best practices #git tutorial for beginners #git tutorials

7 Best Practices in GIT for Your Code Quality
Monty  Boehm

Monty Boehm

1617428820

How To Delete Files or Folders From Remote Git Repository

GIT is great, it has made collaboration with other developers so easy, I can’t thank GIT enough. But GIT is vast and not every command remains on my mind. I find myself googling over and over again to get that right GIT command that can solve my problem.

Recently when working on one of the projects that had just started, I accidentally pushed the IDE folder to the remote repository and I was there googling again, so I thought, why not write a blog for this? I can always come straight to my blog if this happens again and I can also help my fellow developers this way, right?

All sensitive information and IDE related folders should be added to gitignore so they are not tracked by git. You may already know this, but it doesn’t help if your file or folder is already in the remote repository. Today we will learn how we can remove files or folders from remote repositories. Let’s get started!

#git #github #gitlab #git-tags #git-basics #tutorial #guide #version-control

How To Delete Files or Folders From Remote Git Repository
Madyson  Reilly

Madyson Reilly

1604109000

Best Practices for Using Git

Git has become ubiquitous as the preferred version control system (VCS) used by developers. Using Git adds immense value especially for engineering teams where several developers work together since it becomes critical to have a system of integrating everyone’s code reliably.

But with every powerful tool, especially one that involves collaboration with others, it is better to establish conventions to follow lest we shoot ourselves in the foot.

At DeepSource, we’ve put together some guiding principles for our own team that make working with a VCS like Git easier. Here are 5 simple rules you can follow:

1. Make Clean, Single-Purpose Commits

Oftentimes programmers working on something get sidetracked into doing too many things when working on one particular thing — like when you are trying to fix one particular bug and you spot another one, and you can’t resist the urge to fix that as well. And another one. Soon, it snowballs and you end up with so many changes all going together in one commit.

This is problematic, and it is better to keep commits as small and focused as possible for many reasons, including:

  • It makes it easier for other people in the team to look at your change, making code reviews more efficient.
  • If the commit has to be rolled back completely, it’s far easier to do so.
  • It’s straightforward to track these changes with your ticketing system.

Additionally, it helps you mentally parse changes you’ve made using git log.

#open source #git #git basics #git tools #git best practices #git tutorials #git commit

Best Practices for Using Git

Git Rebase Tutorial and Comparison with Git Merge

There are many ways of working with git, if they’re clean, and don’t do damages, probably most of them are good.

But same as space vs. tab, in the IT world is a war between fans of rebase, and fans of git merge.

There are tons of arguments about:

-Which way is better?

-Which one is cleaner?

-Which is more comfortable?

-Which one gives a cleaner git graph?

-Why it’s important, and which one is more dangerous?

#quick help #tutorials #git #git branch #git commit #git interactive rebase

Git Rebase Tutorial and Comparison with Git Merge