In this post I have documented some of the common git commands I use on a regular basis or had used a couple of times for a specific purpose. This is definitely not an exhaustive list but more comprehensive and is meant for quick reference.
#github #gitlab #git #web-development
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
this command will make a file named .git
#github #git #basic-git-commands #git-commands #git-status
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.
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
In this short article, we’ll be exploring some quick git commands that can help us in digging through our repositories’ history of commits. We’ll look at
#git #git-log #git-commands #git-history #aws
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
#open source #git #git basics #git tools #git best practices #git tutorials #git commit
No Git command cheat sheet would be complete without a section on the Git vocabulary, so we’ve included one to help you get to grips with how Git works and how the commands are run on various entities. In fact, let’s begin there:
1Bare RepositoryRepository that doesn’t have a working directory.
2BranchAn active area of development in Git. The newest commit displays the end of the branch.
3BlameRefers to the most recent alteration to every line in the file. Shows Author, Revision, and Time.
4CheckoutThis is talking about the process whereby a particular commit is chosen from the repository and the condition of the file associated with it and the directory tree are reproduced in the working directory.
5CommitRecord of a moment in Git history containing details of a changeset.
6DiffThe difference in changes between saved changes or two Commits.
7Detached HeadThe state in which a specific commit is checked out rather than a branch.
8FetchRetrieves the most recent changes in the branch and the local or remote repositories.
9ForkWhen you Fork the repository, you can add Commits and add Pull Requests.
10HashA unique SHA1 code for each Commit
11HeadThe name of the Commit at the end of a Branch
12IndexA group of files that hold state information.
13MergeIncludes changes from named commits (from when their histories split from the current branch) into the current branch.
14MasterGit’s default development Branch
15OriginThis is the default Upstream Repository
16Pull RequestSuggests changes into the Master Branch
17PushPushes new changes once they’ve been committed
18RepositoryA group of Commits, Branches and Tags to identify Commits.
19Working TreeThe directory of files that you are currently working on
#various #git #git commands #github #plesk git