1597467480
This post isn’t going to explain theoretical concepts behind Git — a version-control system usually managed from the command line, though sometimes managed from a GUI (if we’re Windows programmers, which is me, sometimes). Neither is this a post with in-depth insights or sophisticated actions that can be done in Git and nor is it a post that explains Git and GitHub to non-programmers.
Then what is this? It’s a post in which I gathered basic Git settings that I apply when setting up Git on a new server. This will be my — and hopefully your — one-stop-shop for Git initial configuration definitions.
Let’s start at the beginning — installing Git on a server. Every operating system has its own way of installing Git. Atlassian has a post on its website that lists all the methods for all OSs — Mac, Windows, Linux — and their various flavors. On Centos, which is what’s relevant to me, here is how to install:
sudo yum install git
Every commit is attributed to a specific user. It is recommended that the user’s username and email be set immediately after installation. This is to prevent this message from appearing on the first commit:
Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly:
Setting username and password:
git config --global user.name "Your Name"
git config --global user.email you@example.com
If you want to fix the username and password that were used in the commit, you do it using the --amend
parameter:
git commit --amend --author='Your Name <you@example.com>'
Git can paint its commands’ output in beautiful, easy to read colors, instead of just white:
The easiest way to make this happen is by using running this configuration in the command line:
git config --global color.ui auto
If you want to further enhance it, you can read this answer on unix.stackexchange.
#git #git installation #basic definitions #git user definitions
1597467480
This post isn’t going to explain theoretical concepts behind Git — a version-control system usually managed from the command line, though sometimes managed from a GUI (if we’re Windows programmers, which is me, sometimes). Neither is this a post with in-depth insights or sophisticated actions that can be done in Git and nor is it a post that explains Git and GitHub to non-programmers.
Then what is this? It’s a post in which I gathered basic Git settings that I apply when setting up Git on a new server. This will be my — and hopefully your — one-stop-shop for Git initial configuration definitions.
Let’s start at the beginning — installing Git on a server. Every operating system has its own way of installing Git. Atlassian has a post on its website that lists all the methods for all OSs — Mac, Windows, Linux — and their various flavors. On Centos, which is what’s relevant to me, here is how to install:
sudo yum install git
Every commit is attributed to a specific user. It is recommended that the user’s username and email be set immediately after installation. This is to prevent this message from appearing on the first commit:
Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly:
Setting username and password:
git config --global user.name "Your Name"
git config --global user.email you@example.com
If you want to fix the username and password that were used in the commit, you do it using the --amend
parameter:
git commit --amend --author='Your Name <you@example.com>'
Git can paint its commands’ output in beautiful, easy to read colors, instead of just white:
The easiest way to make this happen is by using running this configuration in the command line:
git config --global color.ui auto
If you want to further enhance it, you can read this answer on unix.stackexchange.
#git #git installation #basic definitions #git user definitions
1604109000
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:
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:
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
1597916460
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.
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.
But is it good? Not quite.
Because you are compromising code quality, and it will take more time to review code. So 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.
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
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
1593435300
In this part you will get familiar with some basic Git commands. At the end of this blog you will be able to perform certain task like
These are those commands you must conquer
<!DOCTYPE html>
<html>
<head></head>
<body>
<h1>Sab Batade Aapko</h1>
</body>
</html>
Initializing the folder as a Git repository
git init
this command will make a file named .git
#github #git #basic-git-commands #git-commands #git-status
1597380660
git — the stupid content tracker
Git has a lot to offer, sometimes is overwhelming, for that reason it’s good to have a practical approach and explanations along the way to grasp the essentials of this magnificent tool.
This is the first part of a series of articles to introduce you to Git and then to level up your working development workflow using git.
Content.
Git history (brief).
Git workflow.
Hands-on Git.
Git history (brief)
git — the stupid content tracker
man page
The problem
A software is a piece of code that grows, in every new feature added a tag is placed in it and you get new versions. Eventually, the owner needs to share that code and allow contributions from other people to make that software better (or worst…). How to achieve this? for the first part, the answer is: Version Control System (VCS) to track the changes. For the second part we have two possible answers:
having a centralized system that keeps track of all the changes in your code.
having a distributed system where all the code is shared among contributors that work merging changes.
So, what Git is? is a Distributed Version Control System
Brief History
In April 2005, Linus Torvalds was working on the 2.6.12 version of his Linux operating system, not pleased with the current VCS available in the market to help him manage his code (BitKeeper as the main one), he decided that he needed to create it’s own to keep track of changes of the Linux core. This system had to be:
Distributed
Fast
Reliable
And… he did it. Git was created. Since then it has been growing almost universally to manage version control and team contributions.
For the sake of brevity, these are the main things to know.
#git #basic definitions #tutorials #command collections #tips collections