[{"data":1,"prerenderedAt":1637},["ShallowReactive",2],{"blog-posts-en-4":3},[4,1212,1332,1381],{"id":5,"title":6,"body":7,"date":1201,"description":1202,"extension":1203,"meta":1204,"navigation":231,"path":1205,"seo":1206,"stem":1207,"tags":1208,"translation":1210,"__hash__":1211},"pages_en\u002Fen\u002Fblog\u002Fgit-commands-every-developer-should-know.md","Git Commands Every Developer Should Know",{"type":8,"value":9,"toc":1191},"minimark",[10,15,28,39,43,46,132,135,185,189,200,329,340,431,435,441,539,542,603,652,655,674,678,691,828,839,843,846,909,920,926,1007,1018,1054,1058,1061,1117,1120,1167,1171,1187],[11,12,14],"h2",{"id":13},"introduction","Introduction",[16,17,18,19,23,24,27],"p",{},"Most of your daily Git work is done with roughly 20 commands; this post collects them in order of use, with examples. Whether you're just starting out or have been using Git for years, bookmark this page for a quick reminder of the difference between ",[20,21,22],"code",{},"reset"," and ",[20,25,26],{},"revert",", or how to recover a lost commit.",[16,29,30,31,34,35,38],{},"The examples use ",[20,32,33],{},"main"," as the default branch and ",[20,36,37],{},"origin"," as the remote name.",[11,40,42],{"id":41},"_1-setup-and-configuration","1. Setup and configuration",[16,44,45],{},"When you first install Git, you only need to introduce yourself once; this information is written into every commit.",[47,48,53],"pre",{"className":49,"code":50,"language":51,"meta":52,"style":52},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","git config --global user.name \"Your Name\"\ngit config --global user.email \"you@example.com\"\ngit config --global init.defaultBranch main\ngit config --list          # show all settings\n","bash","",[20,54,55,84,103,118],{"__ignoreMap":52},[56,57,60,64,68,71,74,78,81],"span",{"class":58,"line":59},"line",1,[56,61,63],{"class":62},"sBMFI","git",[56,65,67],{"class":66},"sfazB"," config",[56,69,70],{"class":66}," --global",[56,72,73],{"class":66}," user.name",[56,75,77],{"class":76},"sMK4o"," \"",[56,79,80],{"class":66},"Your Name",[56,82,83],{"class":76},"\"\n",[56,85,87,89,91,93,96,98,101],{"class":58,"line":86},2,[56,88,63],{"class":62},[56,90,67],{"class":66},[56,92,70],{"class":66},[56,94,95],{"class":66}," user.email",[56,97,77],{"class":76},[56,99,100],{"class":66},"you@example.com",[56,102,83],{"class":76},[56,104,106,108,110,112,115],{"class":58,"line":105},3,[56,107,63],{"class":62},[56,109,67],{"class":66},[56,111,70],{"class":66},[56,113,114],{"class":66}," init.defaultBranch",[56,116,117],{"class":66}," main\n",[56,119,121,123,125,128],{"class":58,"line":120},4,[56,122,63],{"class":62},[56,124,67],{"class":66},[56,126,127],{"class":66}," --list",[56,129,131],{"class":130},"sHwdD","          # show all settings\n",[16,133,134],{},"To start a new project or download an existing repository:",[47,136,138],{"className":49,"code":137,"language":51,"meta":52,"style":52},"git init                                   # turn the current folder into a repo\ngit clone https:\u002F\u002Fgithub.com\u002Fuser\u002Fproject.git\ngit clone \u003Curl> new-folder-name            # clone into a different folder\n",[20,139,140,150,160],{"__ignoreMap":52},[56,141,142,144,147],{"class":58,"line":59},[56,143,63],{"class":62},[56,145,146],{"class":66}," init",[56,148,149],{"class":130},"                                   # turn the current folder into a repo\n",[56,151,152,154,157],{"class":58,"line":86},[56,153,63],{"class":62},[56,155,156],{"class":66}," clone",[56,158,159],{"class":66}," https:\u002F\u002Fgithub.com\u002Fuser\u002Fproject.git\n",[56,161,162,164,166,169,172,176,179,182],{"class":58,"line":105},[56,163,63],{"class":62},[56,165,156],{"class":66},[56,167,168],{"class":76}," \u003C",[56,170,171],{"class":66},"ur",[56,173,175],{"class":174},"sTEyZ","l",[56,177,178],{"class":76},">",[56,180,181],{"class":66}," new-folder-name",[56,183,184],{"class":130},"            # clone into a different folder\n",[11,186,188],{"id":187},"_2-everyday-workflow","2. Everyday workflow",[16,190,191,192,195,196,199],{},"Changes move through three stages: working directory → staging area (",[20,193,194],{},"add",") → repository history (",[20,197,198],{},"commit",").",[47,201,203],{"className":49,"code":202,"language":51,"meta":52,"style":52},"git status                 # what changed, what's staged\ngit status -s              # short format\n\ngit add File.java          # stage a single file\ngit add .                  # stage all changes\ngit add -p                 # stage changes interactively, chunk by chunk\n\ngit commit -m \"Add login validation\"\ngit commit -am \"Message\"   # add + commit tracked files\ngit commit --amend         # fix the last commit (before pushing!)\n",[20,204,205,215,227,233,246,259,272,277,295,316],{"__ignoreMap":52},[56,206,207,209,212],{"class":58,"line":59},[56,208,63],{"class":62},[56,210,211],{"class":66}," status",[56,213,214],{"class":130},"                 # what changed, what's staged\n",[56,216,217,219,221,224],{"class":58,"line":86},[56,218,63],{"class":62},[56,220,211],{"class":66},[56,222,223],{"class":66}," -s",[56,225,226],{"class":130},"              # short format\n",[56,228,229],{"class":58,"line":105},[56,230,232],{"emptyLinePlaceholder":231},true,"\n",[56,234,235,237,240,243],{"class":58,"line":120},[56,236,63],{"class":62},[56,238,239],{"class":66}," add",[56,241,242],{"class":66}," File.java",[56,244,245],{"class":130},"          # stage a single file\n",[56,247,249,251,253,256],{"class":58,"line":248},5,[56,250,63],{"class":62},[56,252,239],{"class":66},[56,254,255],{"class":66}," .",[56,257,258],{"class":130},"                  # stage all changes\n",[56,260,262,264,266,269],{"class":58,"line":261},6,[56,263,63],{"class":62},[56,265,239],{"class":66},[56,267,268],{"class":66}," -p",[56,270,271],{"class":130},"                 # stage changes interactively, chunk by chunk\n",[56,273,275],{"class":58,"line":274},7,[56,276,232],{"emptyLinePlaceholder":231},[56,278,280,282,285,288,290,293],{"class":58,"line":279},8,[56,281,63],{"class":62},[56,283,284],{"class":66}," commit",[56,286,287],{"class":66}," -m",[56,289,77],{"class":76},[56,291,292],{"class":66},"Add login validation",[56,294,83],{"class":76},[56,296,298,300,302,305,307,310,313],{"class":58,"line":297},9,[56,299,63],{"class":62},[56,301,284],{"class":66},[56,303,304],{"class":66}," -am",[56,306,77],{"class":76},[56,308,309],{"class":66},"Message",[56,311,312],{"class":76},"\"",[56,314,315],{"class":130},"   # add + commit tracked files\n",[56,317,319,321,323,326],{"class":58,"line":318},10,[56,320,63],{"class":62},[56,322,284],{"class":66},[56,324,325],{"class":66}," --amend",[56,327,328],{"class":130},"         # fix the last commit (before pushing!)\n",[16,330,331,332,335,336,339],{},"Use ",[20,333,334],{},"diff"," to see what changed and ",[20,337,338],{},"log"," to review history:",[47,341,343],{"className":49,"code":342,"language":51,"meta":52,"style":52},"git diff                   # unstaged changes\ngit diff --staged          # changes about to be committed\ngit log --oneline --graph --all   # readable branch history\ngit log -p File.java       # history of a single file\ngit show \u003Ccommit>          # details of one commit\ngit blame File.java        # who changed which line\n",[20,344,345,355,367,386,399,419],{"__ignoreMap":52},[56,346,347,349,352],{"class":58,"line":59},[56,348,63],{"class":62},[56,350,351],{"class":66}," diff",[56,353,354],{"class":130},"                   # unstaged changes\n",[56,356,357,359,361,364],{"class":58,"line":86},[56,358,63],{"class":62},[56,360,351],{"class":66},[56,362,363],{"class":66}," --staged",[56,365,366],{"class":130},"          # changes about to be committed\n",[56,368,369,371,374,377,380,383],{"class":58,"line":105},[56,370,63],{"class":62},[56,372,373],{"class":66}," log",[56,375,376],{"class":66}," --oneline",[56,378,379],{"class":66}," --graph",[56,381,382],{"class":66}," --all",[56,384,385],{"class":130},"   # readable branch history\n",[56,387,388,390,392,394,396],{"class":58,"line":120},[56,389,63],{"class":62},[56,391,373],{"class":66},[56,393,268],{"class":66},[56,395,242],{"class":66},[56,397,398],{"class":130},"       # history of a single file\n",[56,400,401,403,406,408,411,414,416],{"class":58,"line":248},[56,402,63],{"class":62},[56,404,405],{"class":66}," show",[56,407,168],{"class":76},[56,409,410],{"class":66},"commi",[56,412,413],{"class":174},"t",[56,415,178],{"class":76},[56,417,418],{"class":130},"          # details of one commit\n",[56,420,421,423,426,428],{"class":58,"line":261},[56,422,63],{"class":62},[56,424,425],{"class":66}," blame",[56,427,242],{"class":66},[56,429,430],{"class":130},"        # who changed which line\n",[11,432,434],{"id":433},"_3-branching","3. Branching",[16,436,437,438,440],{},"Opening a separate branch for every feature or bug fix is the easiest way to keep ",[20,439,33],{}," clean.",[47,442,444],{"className":49,"code":443,"language":51,"meta":52,"style":52},"git branch                 # local branches\ngit branch -a              # including remote branches\ngit switch -c feature\u002Flogin     # create and switch to a new branch\ngit switch main                 # switch branches\ngit checkout -b feature\u002Flogin   # older syntax, same job\ngit branch -d feature\u002Flogin     # delete a merged branch\ngit branch -D feature\u002Flogin     # force delete\n",[20,445,446,456,468,484,496,511,525],{"__ignoreMap":52},[56,447,448,450,453],{"class":58,"line":59},[56,449,63],{"class":62},[56,451,452],{"class":66}," branch",[56,454,455],{"class":130},"                 # local branches\n",[56,457,458,460,462,465],{"class":58,"line":86},[56,459,63],{"class":62},[56,461,452],{"class":66},[56,463,464],{"class":66}," -a",[56,466,467],{"class":130},"              # including remote branches\n",[56,469,470,472,475,478,481],{"class":58,"line":105},[56,471,63],{"class":62},[56,473,474],{"class":66}," switch",[56,476,477],{"class":66}," -c",[56,479,480],{"class":66}," feature\u002Flogin",[56,482,483],{"class":130},"     # create and switch to a new branch\n",[56,485,486,488,490,493],{"class":58,"line":120},[56,487,63],{"class":62},[56,489,474],{"class":66},[56,491,492],{"class":66}," main",[56,494,495],{"class":130},"                 # switch branches\n",[56,497,498,500,503,506,508],{"class":58,"line":248},[56,499,63],{"class":62},[56,501,502],{"class":66}," checkout",[56,504,505],{"class":66}," -b",[56,507,480],{"class":66},[56,509,510],{"class":130},"   # older syntax, same job\n",[56,512,513,515,517,520,522],{"class":58,"line":261},[56,514,63],{"class":62},[56,516,452],{"class":66},[56,518,519],{"class":66}," -d",[56,521,480],{"class":66},[56,523,524],{"class":130},"     # delete a merged branch\n",[56,526,527,529,531,534,536],{"class":58,"line":274},[56,528,63],{"class":62},[56,530,452],{"class":66},[56,532,533],{"class":66}," -D",[56,535,480],{"class":66},[56,537,538],{"class":130},"     # force delete\n",[16,540,541],{},"There are two ways to combine branches:",[47,543,545],{"className":49,"code":544,"language":51,"meta":52,"style":52},"git switch main\ngit merge feature\u002Flogin    # merge with a merge commit\ngit switch feature\u002Flogin\ngit rebase main            # replay commits on top of main\ngit rebase -i HEAD~3       # edit\u002Fsquash the last 3 commits\n",[20,546,547,555,567,576,588],{"__ignoreMap":52},[56,548,549,551,553],{"class":58,"line":59},[56,550,63],{"class":62},[56,552,474],{"class":66},[56,554,117],{"class":66},[56,556,557,559,562,564],{"class":58,"line":86},[56,558,63],{"class":62},[56,560,561],{"class":66}," merge",[56,563,480],{"class":66},[56,565,566],{"class":130},"    # merge with a merge commit\n",[56,568,569,571,573],{"class":58,"line":105},[56,570,63],{"class":62},[56,572,474],{"class":66},[56,574,575],{"class":66}," feature\u002Flogin\n",[56,577,578,580,583,585],{"class":58,"line":120},[56,579,63],{"class":62},[56,581,582],{"class":66}," rebase",[56,584,492],{"class":66},[56,586,587],{"class":130},"            # replay commits on top of main\n",[56,589,590,592,594,597,600],{"class":58,"line":248},[56,591,63],{"class":62},[56,593,582],{"class":66},[56,595,596],{"class":66}," -i",[56,598,599],{"class":66}," HEAD~3",[56,601,602],{"class":130},"       # edit\u002Fsquash the last 3 commits\n",[604,605,606,622],"table",{},[607,608,609],"thead",{},[610,611,612,616,619],"tr",{},[613,614,615],"th",{},"Command",[613,617,618],{},"What it does",[613,620,621],{},"When to use",[623,624,625,639],"tbody",{},[610,626,627,633,636],{},[628,629,630],"td",{},[20,631,632],{},"merge",[628,634,635],{},"Preserves history, adds a merge commit",[628,637,638],{},"On shared branches",[610,640,641,646,649],{},[628,642,643],{},[20,644,645],{},"rebase",[628,647,648],{},"Makes history linear",[628,650,651],{},"On local branches not yet pushed",[16,653,654],{},"Golden rule: never rebase a pushed branch that others also use.",[16,656,657,658,661,662,665,666,669,670,673],{},"If a conflict occurs, fix the files, run ",[20,659,660],{},"git add",", then continue with ",[20,663,664],{},"git merge --continue"," or ",[20,667,668],{},"git rebase --continue","; use ",[20,671,672],{},"--abort"," to give up.",[11,675,677],{"id":676},"_4-working-with-remotes","4. Working with remotes",[16,679,680,683,684,687,688,690],{},[20,681,682],{},"fetch"," only downloads; ",[20,685,686],{},"pull"," downloads and merges. When in doubt, ",[20,689,682],{}," first and see what's coming in.",[47,692,694],{"className":49,"code":693,"language":51,"meta":52,"style":52},"git remote -v                          # linked remotes\ngit remote add origin \u003Curl>            # add a remote\n\ngit fetch origin                       # download changes, don't merge\ngit pull                               # fetch + merge\ngit pull --rebase                      # fetch + rebase (cleaner history)\n\ngit push                               # push the current branch\ngit push -u origin feature\u002Flogin       # first push, set upstream\ngit push --force-with-lease            # safe force-push after a rebase\ngit push origin --delete feature\u002Flogin # delete a remote branch\n",[20,695,696,709,731,735,747,757,769,773,783,799,811],{"__ignoreMap":52},[56,697,698,700,703,706],{"class":58,"line":59},[56,699,63],{"class":62},[56,701,702],{"class":66}," remote",[56,704,705],{"class":66}," -v",[56,707,708],{"class":130},"                          # linked remotes\n",[56,710,711,713,715,717,720,722,724,726,728],{"class":58,"line":86},[56,712,63],{"class":62},[56,714,702],{"class":66},[56,716,239],{"class":66},[56,718,719],{"class":66}," origin",[56,721,168],{"class":76},[56,723,171],{"class":66},[56,725,175],{"class":174},[56,727,178],{"class":76},[56,729,730],{"class":130},"            # add a remote\n",[56,732,733],{"class":58,"line":105},[56,734,232],{"emptyLinePlaceholder":231},[56,736,737,739,742,744],{"class":58,"line":120},[56,738,63],{"class":62},[56,740,741],{"class":66}," fetch",[56,743,719],{"class":66},[56,745,746],{"class":130},"                       # download changes, don't merge\n",[56,748,749,751,754],{"class":58,"line":248},[56,750,63],{"class":62},[56,752,753],{"class":66}," pull",[56,755,756],{"class":130},"                               # fetch + merge\n",[56,758,759,761,763,766],{"class":58,"line":261},[56,760,63],{"class":62},[56,762,753],{"class":66},[56,764,765],{"class":66}," --rebase",[56,767,768],{"class":130},"                      # fetch + rebase (cleaner history)\n",[56,770,771],{"class":58,"line":274},[56,772,232],{"emptyLinePlaceholder":231},[56,774,775,777,780],{"class":58,"line":279},[56,776,63],{"class":62},[56,778,779],{"class":66}," push",[56,781,782],{"class":130},"                               # push the current branch\n",[56,784,785,787,789,792,794,796],{"class":58,"line":297},[56,786,63],{"class":62},[56,788,779],{"class":66},[56,790,791],{"class":66}," -u",[56,793,719],{"class":66},[56,795,480],{"class":66},[56,797,798],{"class":130},"       # first push, set upstream\n",[56,800,801,803,805,808],{"class":58,"line":318},[56,802,63],{"class":62},[56,804,779],{"class":66},[56,806,807],{"class":66}," --force-with-lease",[56,809,810],{"class":130},"            # safe force-push after a rebase\n",[56,812,814,816,818,820,823,825],{"class":58,"line":813},11,[56,815,63],{"class":62},[56,817,779],{"class":66},[56,819,719],{"class":66},[56,821,822],{"class":66}," --delete",[56,824,480],{"class":66},[56,826,827],{"class":130}," # delete a remote branch\n",[16,829,830,831,834,835,838],{},"Always use ",[20,832,833],{},"--force-with-lease"," instead of ",[20,836,837],{},"--force",": it stops the push if someone else has pushed since you last looked.",[11,840,842],{"id":841},"_5-undoing-mistakes","5. Undoing mistakes",[16,844,845],{},"The right command depends on what you want to undo:",[604,847,848,857],{},[607,849,850],{},[610,851,852,855],{},[613,853,854],{},"Situation",[613,856,615],{},[623,858,859,869,879,889,899],{},[610,860,861,864],{},[628,862,863],{},"Discard unsaved changes in a file",[628,865,866],{},[20,867,868],{},"git restore File.java",[610,870,871,874],{},[628,872,873],{},"Unstage a file",[628,875,876],{},[20,877,878],{},"git restore --staged File.java",[610,880,881,884],{},[628,882,883],{},"Undo the last commit, keep the changes",[628,885,886],{},[20,887,888],{},"git reset --soft HEAD~1",[610,890,891,894],{},[628,892,893],{},"Delete the last commit and its changes",[628,895,896],{},[20,897,898],{},"git reset --hard HEAD~1",[610,900,901,904],{},[628,902,903],{},"Safely undo a pushed commit",[628,905,906],{},[20,907,908],{},"git revert \u003Ccommit>",[16,910,911,913,914,916,917,919],{},[20,912,22],{}," rewrites history, while ",[20,915,26],{}," adds a new commit that undoes the change; always use ",[20,918,26],{}," on shared branches.",[16,921,331,922,925],{},[20,923,924],{},"stash"," to set aside unfinished work:",[47,927,929],{"className":49,"code":928,"language":51,"meta":52,"style":52},"git stash                      # stash your changes\ngit stash push -m \"half-done login\"   # stash with a name\ngit stash list                 # list stashes\ngit stash pop                  # apply and drop the latest stash\ngit stash apply stash@{1}      # apply a specific stash\n",[20,930,931,941,961,973,985],{"__ignoreMap":52},[56,932,933,935,938],{"class":58,"line":59},[56,934,63],{"class":62},[56,936,937],{"class":66}," stash",[56,939,940],{"class":130},"                      # stash your changes\n",[56,942,943,945,947,949,951,953,956,958],{"class":58,"line":86},[56,944,63],{"class":62},[56,946,937],{"class":66},[56,948,779],{"class":66},[56,950,287],{"class":66},[56,952,77],{"class":76},[56,954,955],{"class":66},"half-done login",[56,957,312],{"class":76},[56,959,960],{"class":130},"   # stash with a name\n",[56,962,963,965,967,970],{"class":58,"line":105},[56,964,63],{"class":62},[56,966,937],{"class":66},[56,968,969],{"class":66}," list",[56,971,972],{"class":130},"                 # list stashes\n",[56,974,975,977,979,982],{"class":58,"line":120},[56,976,63],{"class":62},[56,978,937],{"class":66},[56,980,981],{"class":66}," pop",[56,983,984],{"class":130},"                  # apply and drop the latest stash\n",[56,986,987,989,991,994,997,1001,1004],{"class":58,"line":248},[56,988,63],{"class":62},[56,990,937],{"class":66},[56,992,993],{"class":66}," apply",[56,995,996],{"class":66}," stash@{",[56,998,1000],{"class":999},"sbssI","1",[56,1002,1003],{"class":66},"}",[56,1005,1006],{"class":130},"      # apply a specific stash\n",[16,1008,1009,1010,1013,1014,1017],{},"Your last resort is ",[20,1011,1012],{},"reflog",": even commits \"lost\" after ",[20,1015,1016],{},"reset --hard"," show up here.",[47,1019,1021],{"className":49,"code":1020,"language":51,"meta":52,"style":52},"git reflog                     # everywhere HEAD has been\ngit reset --hard HEAD@{2}      # go back to that point\n",[20,1022,1023,1033],{"__ignoreMap":52},[56,1024,1025,1027,1030],{"class":58,"line":59},[56,1026,63],{"class":62},[56,1028,1029],{"class":66}," reflog",[56,1031,1032],{"class":130},"                     # everywhere HEAD has been\n",[56,1034,1035,1037,1040,1043,1046,1049,1051],{"class":58,"line":86},[56,1036,63],{"class":62},[56,1038,1039],{"class":66}," reset",[56,1041,1042],{"class":66}," --hard",[56,1044,1045],{"class":66}," HEAD@{",[56,1047,1048],{"class":999},"2",[56,1050,1003],{"class":66},[56,1052,1053],{"class":130},"      # go back to that point\n",[11,1055,1057],{"id":1056},"_6-time-saving-tips","6. Time-saving tips",[16,1059,1060],{},"Define aliases for commands you type often:",[47,1062,1064],{"className":49,"code":1063,"language":51,"meta":52,"style":52},"git config --global alias.st status\ngit config --global alias.co checkout\ngit config --global alias.lg \"log --oneline --graph --all\"\n# Now: git st, git lg\n",[20,1065,1066,1080,1094,1112],{"__ignoreMap":52},[56,1067,1068,1070,1072,1074,1077],{"class":58,"line":59},[56,1069,63],{"class":62},[56,1071,67],{"class":66},[56,1073,70],{"class":66},[56,1075,1076],{"class":66}," alias.st",[56,1078,1079],{"class":66}," status\n",[56,1081,1082,1084,1086,1088,1091],{"class":58,"line":86},[56,1083,63],{"class":62},[56,1085,67],{"class":66},[56,1087,70],{"class":66},[56,1089,1090],{"class":66}," alias.co",[56,1092,1093],{"class":66}," checkout\n",[56,1095,1096,1098,1100,1102,1105,1107,1110],{"class":58,"line":105},[56,1097,63],{"class":62},[56,1099,67],{"class":66},[56,1101,70],{"class":66},[56,1103,1104],{"class":66}," alias.lg",[56,1106,77],{"class":76},[56,1108,1109],{"class":66},"log --oneline --graph --all",[56,1111,83],{"class":76},[56,1113,1114],{"class":58,"line":120},[56,1115,1116],{"class":130},"# Now: git st, git lg\n",[16,1118,1119],{},"A few small habits make a big difference:",[1121,1122,1123,1142,1145,1151,1158],"ul",{},[1124,1125,1126,1127,1130,1131,1134,1135,1134,1138,1141],"li",{},"Add a ",[20,1128,1129],{},".gitignore"," file in the project's first commit (",[20,1132,1133],{},"target\u002F",", ",[20,1136,1137],{},"*.class",[20,1139,1140],{},".idea\u002F",", etc.).",[1124,1143,1144],{},"Write commit messages in the imperative mood and keep them short: \"Add login validation\".",[1124,1146,331,1147,1150],{},[20,1148,1149],{},"git bisect"," to binary-search for the commit that introduced a bug.",[1124,1152,1153,1154,1157],{},"Move a specific commit to another branch with ",[20,1155,1156],{},"git cherry-pick \u003Ccommit>",".",[1124,1159,1160,1161,23,1164,1157],{},"Tag releases with ",[20,1162,1163],{},"git tag -a v1.0 -m \"First release\"",[20,1165,1166],{},"git push --tags",[11,1168,1170],{"id":1169},"conclusion","Conclusion",[16,1172,1173,1174,23,1176,1178,1179,1134,1181,1183,1184,1186],{},"You'll memorize most of these commands in your first week; the lifesavers like ",[20,1175,1012],{},[20,1177,26],{}," are what you'll come back to this page for when you need them. The best practice is to open a throwaway repo and learn ",[20,1180,22],{},[20,1182,645],{},", and ",[20,1185,924],{}," by breaking things there.",[1188,1189,1190],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":52,"searchDepth":86,"depth":86,"links":1192},[1193,1194,1195,1196,1197,1198,1199,1200],{"id":13,"depth":86,"text":14},{"id":41,"depth":86,"text":42},{"id":187,"depth":86,"text":188},{"id":433,"depth":86,"text":434},{"id":676,"depth":86,"text":677},{"id":841,"depth":86,"text":842},{"id":1056,"depth":86,"text":1057},{"id":1169,"depth":86,"text":1170},"2026-10-09","Most daily Git work runs on about 20 commands — here they are in order of use, with examples.","md",{},"\u002Fen\u002Fblog\u002Fgit-commands-every-developer-should-know",{"title":6,"description":1202},"en\u002Fblog\u002Fgit-commands-every-developer-should-know",[63,1209],"guide","\u002Fblog\u002Fgit-commands-every-developer-should-know","PvSpnP7Cj3MgLejGn28cYmBJKSVxzYbXhRcdX2nQisY",{"id":1213,"title":1214,"body":1215,"date":1322,"description":1323,"extension":1203,"meta":1324,"navigation":231,"path":1325,"seo":1326,"stem":1327,"tags":1328,"translation":1330,"__hash__":1331},"pages_en\u002Fen\u002Fblog\u002Fcreate-a-web-project-with-tailwind-css.md","Create a web project with Tailwind CSS",{"type":8,"value":1216,"toc":1313},[1217,1221,1229,1233,1239,1242,1246,1249,1255,1259,1262,1268,1272,1275,1281,1285,1288,1294,1298,1304,1307],[11,1218,1220],{"id":1219},"project-folder-and-nodejs-activation","Project folder and Node.js activation",[47,1222,1227],{"className":1223,"code":1225,"language":1226},[1224],"language-text","mkdir tailwind-demo\ncd tailwind-demo\nnpm init\n","text",[20,1228,1225],{"__ignoreMap":52},[11,1230,1232],{"id":1231},"install-tailwind-css","Install Tailwind CSS",[47,1234,1237],{"className":1235,"code":1236,"language":1226},[1224],"npm install -D tailwindcss\nnpx tailwindcss init\n",[20,1238,1236],{"__ignoreMap":52},[16,1240,1241],{},"You will have dev dependency for tailwind and tailwind.config.css",[11,1243,1245],{"id":1244},"configure-path","Configure path",[16,1247,1248],{},"Change content element like below to dedicate the directory.",[47,1250,1253],{"className":1251,"code":1252,"language":1226},[1224],"content: [\".\u002Fsrc\u002F**\u002F*.{html,js}\"],\n",[20,1254,1252],{"__ignoreMap":52},[11,1256,1258],{"id":1257},"add-tailwind-directives","Add Tailwind directives",[16,1260,1261],{},"Create src folder and input.css file. You will have src\u002Finput.css, then add below lines.",[47,1263,1266],{"className":1264,"code":1265,"language":1226},[1224],"@tailwind base;\n@tailwind components;\n@tailwind utilities;\n",[20,1267,1265],{"__ignoreMap":52},[11,1269,1271],{"id":1270},"tailwind-css-watch-tool-into-packagejson","Tailwind CSS Watch Tool into package.json",[16,1273,1274],{},"Add this watch script into your package.json scripts section. We will start our project with this command later.",[47,1276,1279],{"className":1277,"code":1278,"language":1226},[1224],"\"watch\": \"npx tailwindcss -i .\u002Fsrc\u002Finput.css -o .\u002Fdist\u002Foutput.css --watch\"\n",[20,1280,1278],{"__ignoreMap":52},[11,1282,1284],{"id":1283},"create-a-html-page-for-testing-purpose","Create a HTML page for testing purpose",[16,1286,1287],{},"Under src folder create an index.html file, then add below lines.",[47,1289,1292],{"className":1290,"code":1291,"language":1226},[1224],"\u003C!doctype html>\n\u003Chtml>\n\u003Chead>\n  \u003Cmeta charset=\"UTF-8\">\n  \u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  \u003Clink href=\"\u002Fdist\u002Foutput.css\" rel=\"stylesheet\">\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Ch1 class=\"text-3xl font-bold underline\">\n    Hello world!\n  \u003C\u002Fh1>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n",[20,1293,1291],{"__ignoreMap":52},[11,1295,1297],{"id":1296},"start-your-project","Start your project",[47,1299,1302],{"className":1300,"code":1301,"language":1226},[1224],"npm run watch\n",[20,1303,1301],{"__ignoreMap":52},[16,1305,1306],{},"Open index.html file in your browser by using LiveServer or another testing tool. You will see the page with Tailwind support. Enjoy.",[47,1308,1311],{"className":1309,"code":1310,"language":1226},[1224],"http:\u002F\u002F127.0.0.1:5500\u002Fsrc\u002Findex.html\n",[20,1312,1310],{"__ignoreMap":52},{"title":52,"searchDepth":86,"depth":86,"links":1314},[1315,1316,1317,1318,1319,1320,1321],{"id":1219,"depth":86,"text":1220},{"id":1231,"depth":86,"text":1232},{"id":1244,"depth":86,"text":1245},{"id":1257,"depth":86,"text":1258},{"id":1270,"depth":86,"text":1271},{"id":1283,"depth":86,"text":1284},{"id":1296,"depth":86,"text":1297},"2022-12-18","Setting up a web project with Tailwind CSS: project init, config paths, directives, and building the CSS.",{},"\u002Fen\u002Fblog\u002Fcreate-a-web-project-with-tailwind-css",{"title":1214,"description":1323},"en\u002Fblog\u002Fcreate-a-web-project-with-tailwind-css",[1329],"application servers","\u002Fblog\u002Fcreate-a-web-project-with-tailwind-css","At4s4Du2VFiO_0MtrNYmsiMGK76YqGt2cJTNb3prfmM",{"id":1333,"title":1334,"body":1335,"date":1372,"description":1373,"extension":1203,"meta":1374,"navigation":231,"path":1375,"seo":1376,"stem":1377,"tags":1378,"translation":1379,"__hash__":1380},"pages_en\u002Fen\u002Fblog\u002Finstall-go-on-centos.md","Install Go on CentOS",{"type":8,"value":1336,"toc":1367},[1337,1341,1347,1351,1357,1361],[11,1338,1340],{"id":1339},"check-version","Check Version",[47,1342,1345],{"className":1343,"code":1344,"language":1226},[1224],"go version\n",[20,1346,1344],{"__ignoreMap":52},[11,1348,1350],{"id":1349},"download-and-unzip","Download and Unzip",[47,1352,1355],{"className":1353,"code":1354,"language":1226},[1224],"wget https:\u002F\u002Fgo.dev\u002Fdl\u002Fgo1.18.5.linux-amd64.tar.gz\n\ntar -C \u002Fusr\u002Flocal -zxvf go1.18.5.linux-amd64.tar.gz\n",[20,1356,1354],{"__ignoreMap":52},[11,1358,1360],{"id":1359},"add-to-environment-variable-and-take-effect","Add to Environment Variable and Take Effect",[47,1362,1365],{"className":1363,"code":1364,"language":1226},[1224],"vi \u002Fetc\u002Fprofile\n\nexport PATH=$PATH:\u002Fusr\u002Flocal\u002Fgo\u002Fbin\n\nsource \u002Fetc\u002Fprofile\n",[20,1366,1364],{"__ignoreMap":52},{"title":52,"searchDepth":86,"depth":86,"links":1368},[1369,1370,1371],{"id":1339,"depth":86,"text":1340},{"id":1349,"depth":86,"text":1350},{"id":1359,"depth":86,"text":1360},"2022-10-31","Installing Go on CentOS: download, extract to \u002Fusr\u002Flocal, and PATH configuration.",{},"\u002Fen\u002Fblog\u002Finstall-go-on-centos",{"title":1334,"description":1373},"en\u002Fblog\u002Finstall-go-on-centos",[1329],"\u002Fblog\u002Finstall-go-on-centos","_qB76SgXwbOommOXW9jXJPBOQUSsSFWk8ot9jyoZnS8",{"id":1382,"title":1383,"body":1384,"date":1372,"description":1628,"extension":1203,"meta":1629,"navigation":231,"path":1630,"seo":1631,"stem":1632,"tags":1633,"translation":1635,"__hash__":1636},"pages_en\u002Fen\u002Fblog\u002Flinux-best-practices.md","Linux Best Practices",{"type":8,"value":1385,"toc":1626},[1386,1392,1410,1415,1442,1447,1467,1472,1504,1509,1536,1541,1553,1558,1567,1572,1585,1590,1623],[16,1387,1388],{},[1389,1390,1391],"strong",{},"CPU",[47,1393,1395],{"className":49,"code":1394,"language":51,"meta":52,"style":52},"lscpu\ncat \u002Fproc\u002Fcpuinfo\n",[20,1396,1397,1402],{"__ignoreMap":52},[56,1398,1399],{"class":58,"line":59},[56,1400,1401],{"class":62},"lscpu\n",[56,1403,1404,1407],{"class":58,"line":86},[56,1405,1406],{"class":62},"cat",[56,1408,1409],{"class":66}," \u002Fproc\u002Fcpuinfo\n",[16,1411,1412],{},[1389,1413,1414],{},"Memory Usage",[47,1416,1418],{"className":49,"code":1417,"language":51,"meta":52,"style":52},"free\ncat \u002Fproc\u002Fmeminfo\ntop\nhtop\n",[20,1419,1420,1425,1432,1437],{"__ignoreMap":52},[56,1421,1422],{"class":58,"line":59},[56,1423,1424],{"class":62},"free\n",[56,1426,1427,1429],{"class":58,"line":86},[56,1428,1406],{"class":62},[56,1430,1431],{"class":66}," \u002Fproc\u002Fmeminfo\n",[56,1433,1434],{"class":58,"line":105},[56,1435,1436],{"class":62},"top\n",[56,1438,1439],{"class":58,"line":120},[56,1440,1441],{"class":62},"htop\n",[16,1443,1444],{},[1389,1445,1446],{},"Disk Usage",[47,1448,1450],{"className":49,"code":1449,"language":51,"meta":52,"style":52},"df -h\ndu -h\n",[20,1451,1452,1460],{"__ignoreMap":52},[56,1453,1454,1457],{"class":58,"line":59},[56,1455,1456],{"class":62},"df",[56,1458,1459],{"class":66}," -h\n",[56,1461,1462,1465],{"class":58,"line":86},[56,1463,1464],{"class":62},"du",[56,1466,1459],{"class":66},[16,1468,1469],{},[1389,1470,1471],{},"OS Check",[47,1473,1475],{"className":49,"code":1474,"language":51,"meta":52,"style":52},"cat \u002Fetc\u002Fos-release\ncat \u002Fetc\u002Fsystem-release\nlsb_release -a\nsw_vers\n",[20,1476,1477,1484,1491,1499],{"__ignoreMap":52},[56,1478,1479,1481],{"class":58,"line":59},[56,1480,1406],{"class":62},[56,1482,1483],{"class":66}," \u002Fetc\u002Fos-release\n",[56,1485,1486,1488],{"class":58,"line":86},[56,1487,1406],{"class":62},[56,1489,1490],{"class":66}," \u002Fetc\u002Fsystem-release\n",[56,1492,1493,1496],{"class":58,"line":105},[56,1494,1495],{"class":62},"lsb_release",[56,1497,1498],{"class":66}," -a\n",[56,1500,1501],{"class":58,"line":120},[56,1502,1503],{"class":62},"sw_vers\n",[16,1505,1506],{},[1389,1507,1508],{},"Users",[47,1510,1512],{"className":49,"code":1511,"language":51,"meta":52,"style":52},"w\nwho\nusers\ncat \u002Fetc\u002Fpasswd\n",[20,1513,1514,1519,1524,1529],{"__ignoreMap":52},[56,1515,1516],{"class":58,"line":59},[56,1517,1518],{"class":62},"w\n",[56,1520,1521],{"class":58,"line":86},[56,1522,1523],{"class":62},"who\n",[56,1525,1526],{"class":58,"line":105},[56,1527,1528],{"class":62},"users\n",[56,1530,1531,1533],{"class":58,"line":120},[56,1532,1406],{"class":62},[56,1534,1535],{"class":66}," \u002Fetc\u002Fpasswd\n",[16,1537,1538],{},[1389,1539,1540],{},"Groups",[47,1542,1544],{"className":49,"code":1543,"language":51,"meta":52,"style":52},"cat \u002Fetc\u002Fgroup\n",[20,1545,1546],{"__ignoreMap":52},[56,1547,1548,1550],{"class":58,"line":59},[56,1549,1406],{"class":62},[56,1551,1552],{"class":66}," \u002Fetc\u002Fgroup\n",[16,1554,1555],{},[1389,1556,1557],{},"Change Password",[47,1559,1561],{"className":49,"code":1560,"language":51,"meta":52,"style":52},"passwd\n",[20,1562,1563],{"__ignoreMap":52},[56,1564,1565],{"class":58,"line":59},[56,1566,1560],{"class":62},[16,1568,1569],{},[1389,1570,1571],{},"Port Check",[47,1573,1575],{"className":49,"code":1574,"language":51,"meta":52,"style":52},"netstat -ant\n",[20,1576,1577],{"__ignoreMap":52},[56,1578,1579,1582],{"class":58,"line":59},[56,1580,1581],{"class":62},"netstat",[56,1583,1584],{"class":66}," -ant\n",[16,1586,1587],{},[1389,1588,1589],{},"Change Directory",[604,1591,1592,1601],{},[607,1593,1594],{},[610,1595,1596,1598],{},[613,1597,615],{},[613,1599,1600],{},"Description",[623,1602,1603,1613],{},[610,1604,1605,1610],{},[628,1606,1607],{},[20,1608,1609],{},"cd \u002Fpath\u002Fto\u002Fyou\u002Fwant\u002Fto\u002Fgo",[628,1611,1612],{},"Changes to the directory you want",[610,1614,1615,1620],{},[628,1616,1617],{},[20,1618,1619],{},"cd -",[628,1621,1622],{},"Changes to the directory you were in before",[1188,1624,1625],{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":52,"searchDepth":86,"depth":86,"links":1627},[],"Frequently used Linux system commands and good practices: CPU, memory, disk, user, and port management.",{},"\u002Fen\u002Fblog\u002Flinux-best-practices",{"title":1383,"description":1628},"en\u002Fblog\u002Flinux-best-practices",[1634],"linux","\u002Fblog\u002Flinux-best-practices","BeZyv87_Pup3deTEK2bs-aHsFtueSWZZt7ElxQ61gQ4",1792353224468]