Skip to content

jinnabaalu/GitCheatSheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Git Cheat Sheet

Introduction

There are many questions or use cases we come across in our day to day activity, like

  • How multiple contributors can push their changes together to one project without any overhead? The answer is with git branching.

  • Who is the contributor to the repository? only developers? The Answer is One who is part of the project will be the contributors in one way or the other. One who writes the code developer, one who writes the configurations, system administrator, one who creates the DevOps configurations, one who writes the playbooks, recipes, and pipelines.

  • What is code review? is it mandatory?

  • How to revert changes to the working commit?

  • git vs github/gitlab/bitbucket?

  • How to create the repository in GitHub/GitLab/bitbucket?

  • How to initialize the repository?

  • How to create the repository? git clone vs git pull?

  • Difference between cloning with https:// vs git:/?

  • How branching works in the case of multiple contributors?

  • Best practice to resolve conflicts?

  • What is a pull request? Is a pull request mandatory? and when?

  • Who is the reviewer? can a bot review on behalf? and how?

  • BAD or GOOD? mono repo vs poly repo?

This is an endless set of questions we have in our mind when we read about the git and practicing git. How we get rid of the question bank about the git in the brain? My answer would be it is an endless learning about the git, in our day-to-day activity we do and use-cases we come across will teach us how to use git the right way?

I will try to cover them from my experience with the different blog posts which alone explains each topic from scratch.

USE CASES

Git for developer Git for Operations
git config git commands for devops
git init common git commands
generate ssh key git for project leads/manager
create the repository in github(remote repository) switch remote url from HTTPS to SSH
instructions to push local changes to repository
create new branch
branch management
delete commits
git merge
git reset

Naming conventions for branch names or any programming language

  • UpperCamelCase - CamelCase - Ex: JinnaBalu

  • lowerCamelCase - camelCase (pascalCase) - Ex: jinnaBalu

  • SnakeCase

    • snake_case (lower_case_with_underscores) - Ex: jinna_balu
    • CAPITALIZED_WITH_UNDERSCORES
  • kebab-case or lisp-case - kebeb-case(hyphen-case) - Ex: `jinna-balu``

Blogs