Follow dba-ninja.com

Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions

dba-ninja.com Links

Dba_db2_button

Sqlserver_dba_button

GIT cheat sheet

20 September,2023 by Rambler

Compiling a list of GIT commands used regularly in my daily work. Adding more over the next few daysModels

MODELS

========

Gitflow - Focus on long lif feature branches and multiple primary branches . More collaboration required - and strict development method. 

Trunk-based development - Developers merge small, regular update to the core - trunk also know as "main branch" . Used in CI\CD

 

BASICS

=====

--Clone the repository to the local machine 

git clone https://mygithub2.com/myproject.git

 

--Check status of file 

--Files marked in red are in the file system, but Git not tracking them yet.

git status

--Track the file 

git add myFilename

 

-- Commit aka save your file to the  local copy of the project’s Git repository

git commit -m "a commit test"

 

--show refs

git show-ref

--Show commit history 

git log 

--Display unstaged changes 

git diff 

 

PUSH

======

--Push aka your changes from you up to GitHub

--origin = repository of copy in GitHub 

git push origin <replace_with_branch_name>

 

BRANCHES

======

--Display branches in the repo

git branch

--Create and check out a new branch named <MyBranch>. Don't use the -b flag for checking out an existing branch. 

git checkout -b <MyBranch>

CONFIG

======

git config --global http.sslVerify false 

 

 


Author: Rambler (http://www.dba-ninja.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on GIT cheat sheet


dba-ninja.com