{"id":772,"date":"2021-01-26T10:13:47","date_gmt":"2021-01-26T09:13:47","guid":{"rendered":"https:\/\/nguenkam.com\/blog\/?p=772"},"modified":"2023-08-03T09:58:47","modified_gmt":"2023-08-03T07:58:47","slug":"useful-git-commands-for-common-git-tasks","status":"publish","type":"post","link":"https:\/\/nguenkam.com\/blog\/index.php\/2021\/01\/26\/useful-git-commands-for-common-git-tasks\/","title":{"rendered":"useful git commands for common tasks"},"content":{"rendered":"\n<h4><span class=\"has-inline-color has-vivid-cyan-blue-color\"> <strong><code>$git config<\/code><\/strong><\/span><\/h4>\n\n\n\n<p>You can use it to&nbsp;<strong>configure<\/strong>&nbsp;the author&#8217;s name, email address, file formats and many more to be used with your commits.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git config --global user.name \"Brice\"\ngit config --global user.email \"brice@example.com\"<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4><strong><code><span class=\"has-inline-color has-vivid-cyan-blue-color\">$git init<\/span><\/code><\/strong><\/h4>\n\n\n\n<p>Using this command you make it sure that your&nbsp;<strong>git repository<\/strong>&nbsp;is initialized and creates the initial&nbsp;<code>.git<\/code>&nbsp;directory in a new or in an existing project. The output will be the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$  git init<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><em>You can undo a&nbsp;<code>$git init<\/code>&nbsp;with&nbsp;<code>rm -rf .git<\/code>.<\/em>\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Link a local project with a remote repository<\/span><\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>git remote add origin https:\/\/github.com\/T-z\/androidMe.git\nor \ngit remote add origin https:\/\/github.com\/T-z\/androidMe<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">then now, \"origin\" have an url, \nand when you make <strong>git push -u origin master<\/strong>,\nyou are pushing your local change in the remote repository \n(in the master branch).\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Change Git Remote URL<\/span><\/h5>\n\n\n\n<p>For example, let\u2019s say that you want to&nbsp;<strong>change the URL of your&nbsp;<a href=\"https:\/\/git-scm.com\/book\/en\/v2\/Git-Basics-Working-with-Remotes\">Git origin remote<\/a><\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git remote set-url origin https:\/\/git-repo\/new-repository.git<\/code><\/pre>\n\n\n\n<p>In order to verify that the changes were made, you can use the \u201cgit remote\u201d command with the \u201c-v\u201d option (for verbose)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git remote -v<\/code><\/pre>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Copy a repository<\/span><\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone \/path\/repository<\/code><\/pre>\n\n\n\n<p>You can clone one specific branch at a time:&nbsp;<strong><code>git clone -b &lt;branch_name&gt;&lt;repository_url&gt;<\/code>:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone -b branch_name git@github:user\/repository.git<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Push Branch to Another Repository<\/span><\/h5>\n\n\n\n<p>In order to push a branch to another repository, you need to execute the \u201cgit push\u201d command, and specify the correct remote name as well as the branch to be pushed<strong>.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git push &lt;remote&gt; &lt;branch&gt;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Rename a Branch <\/span><\/h5>\n\n\n\n<p>To rename a branch in Git, you can follow these steps:<\/p>\n\n\n\n<ul><li>Check out a different branch. This step is necessary because you can&#8217;t rename the branch you are currently on. You can switch to any existing branch using the command <code>git checkout &lt;branch-name&gt;<\/code>.<\/li><li>Rename the branch using the <code>-m<\/code> option with the <code>git branch<\/code> command. Type the following command, replacing <code>&lt;old-branch-name&gt;<\/code> with the name of the branch you want to rename and <code>&lt;new-branch-name&gt;<\/code> with the desired new name:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>git branch -m &lt;old-branch-name&gt; &lt;new-branch-name&gt;\n\n\/\/ For example, if you want to rename a branch called \"feature\/foo\" to \"feature\/bar\", you \/\/would run:\n\ngit branch -m feature\/foo feature\/bar\n\n<\/code><\/pre>\n\n\n\n<p>If the branch you renamed is the currently checked out branch, you need to update the upstream branch reference as well. Use the following command, replacing <code>&lt;new-branch-name&gt;<\/code> with the new name of the branch:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git push origin -u &lt;new-branch-name&gt;\n\n\n\/\/This command updates the upstream reference to the new branch name on the remote \/\/repository.<\/code><\/pre>\n\n\n\n<p>Verify that the branch has been renamed by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git branch -a\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">The remote repository (URL)<\/span><\/h5>\n\n\n\n<p>In order to see the remotes defined in your repository, you have to execute the \u201cgit remote\u201d command with the \u201c-v\u201d option for \u201cverbose\u201d.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git remote -v\n\norigin  https:\/\/github.com\/user\/repo.git (fetch)\norigin  https:\/\/github.com\/user\/repo.git (push)\ncustom  https:\/\/github.com\/user\/custom.git (fetch)\ncustom  https:\/\/github.com\/user\/custom.git (push)<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Push Branch to Another Branch<\/span><\/h5>\n\n\n\n<p>In some cases, you may want to push your changes to another branch on the remote repository.<\/p>\n\n\n\n<p>As an example, let\u2019s say that you have created a local branch named \u201cmy-feature\u201d.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git branch\n\n  master\n* my-feature\n  feature<\/code><\/pre>\n\n\n\n<p>However, you want to push your changes to the <strong>remote branch<\/strong> named \u201c<em>feature<\/em>\u201d on your repository.<\/p>\n\n\n\n<p>In order to push your branch to the \u201c<em>feature<\/em>\u201d branch, you would execute the following command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git push origin my-feature:feature<\/code><\/pre>\n\n\n\n<p>In order to push your branch to another branch, you may need to merge the remote branch to your current local branch.<\/p>\n\n\n\n<p>In order to be merged, the tip of the remote branch cannot be behind the branch you are trying to push.<\/p>\n\n\n\n<p>Before pushing, make sure to pull the changes from the remote branch and integrate them with your current local branch.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git pull\n\n$ git checkout my-feature\n\n$ git merge origin\/feature\n\n$ git push origin my-feature:feature<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Note&nbsp;<\/strong>: when merging the remote branch, you are merging your local\n branch with the upstream branch of your local repository.\n<strong>Rembember:<\/strong> <span class=\"has-inline-color has-vivid-red-color\">After you pushed the change in the branch feature,\n The remote branch my-feature will be deleted.<\/span>\n\n\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">List All Branches<\/span><\/h5>\n\n\n\n<p>To see&nbsp;<strong>local branches<\/strong>, run this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git branch<\/code><\/pre>\n\n\n\n<p>To see&nbsp;<strong>remote branches<\/strong>, run this command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git branch -r<\/code><\/pre>\n\n\n\n<p>To see&nbsp;<strong>all local and remote branches<\/strong>, run this command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git branch -a<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Switch to a Branch That Came From a Remote Repo<\/span><\/h5>\n\n\n\n<p>Run this command to switch to the branch:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ 1. To get a list of all branches from the remote, run this command:\ngit pull\n\n\/\/ then Run this command to switch to the branch\ngit checkout --track origin\/my-branch-name<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Comparing Actual Changes Between Two Branches<\/span><\/h5>\n\n\n\n<p>Let&#8217;s say you&#8217;d like to take a look at a feature branch named &#8220;feature\/login&#8221;. You want to see all changes that are different from &#8220;master&#8221; &#8211; to get an idea of what would be integrated if you performed e.g. a&nbsp;<code>git merge<\/code>&nbsp;now.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git diff master..feature\/login<\/code><\/pre>\n\n\n\n<p>you can also have Git show you the&nbsp;<em>commits<\/em>&nbsp;that are different. The solution is very similar, although we have to use the&nbsp;<code>git log<\/code>&nbsp;command in this case:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git log master..feature\/login<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">git log is a command with dozens of interesting options.\n Feel free to tinker around a bit, for example by using the&nbsp;\n<code>--oneline<\/code>&nbsp;option to make the output a bit more concise:<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git log --oneline master..feature\/login<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Comparing A Specific File Between Branches<\/span><\/h5>\n\n\n\n<p>Sometimes, you might want to compare how exactly a&nbsp;<em>certain file<\/em>&nbsp;is different in two branches. Simply add the file&#8217;s path to our&nbsp;<code>git diff<\/code>&nbsp;command from above:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git diff main..feature\/login index.html<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Discarding Local Changes in a File<\/span><\/h5>\n\n\n\n<p>Changes that haven&#8217;t been committed to the local repository are called &#8220;local&#8221; changes in Git. They exist in your Working Copy, but you haven&#8217;t wrapped them in a commit, yet.<\/p>\n\n\n\n<p>If you want to discard this type of changes, you can use the&nbsp;<code>git restore<\/code>&nbsp;command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git restore index.html\n\/\/ This will undo all uncommitted local changes in the specified file. Please be careful \/\/ \/\/ because you cannot get these changes back once you've discarded them!<\/code><\/pre>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Discarding All Local Changes<\/span><\/h5>\n\n\n\n<p>If you want to undo&nbsp;<em>all<\/em>&nbsp;of your current changes, you can use the&nbsp;<code>git restore<\/code>&nbsp;command with the &#8220;.&#8221; parameter (instead of specifying a file path):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git restore .<\/code><\/pre>\n\n\n\n<p>If, additionally, you have untracked (= new) files in your Working Copy and want to get rid of those, too, then the&nbsp;<code>git clean<\/code>&nbsp;command is your friend:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git clean -f<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">View the change history of a specific file<\/span><\/h5>\n\n\n\n<p>To view the change history of an individual file : complete details with what has changed?<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git log -p filename<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Git : Who changes\/modify the the file\/line<\/span><\/h5>\n\n\n\n<p>If you only need the last change:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git blame &lt;filename&gt;\n\/\/or\ngit annotate &lt;filename&gt; <\/code><\/pre>\n\n\n\n<p>To see commits affecting line 40 of file foo:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git blame -L 40,+1 foo\n<\/code><\/pre>\n\n\n\n<p>The +1 means exactly one line. To see changes for lines 40-60, it&#8217;s:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git blame -L 40,+21 foo\n<\/code><\/pre>\n\n\n\n<p>OR<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git blame -L 40,60 foo<\/code><\/pre>\n\n\n\n<p>The second number can be an offset designated with a &#8216;+&#8217;, or a line number.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Merging 2 branches<\/span><\/h5>\n\n\n\n<p>Let\u00b4s assume we have created a new branch, and we made some changes \/ commits on it.  The branch can now be merged back into the main code branch (usually master). That is how we shall do: <\/p>\n\n\n\n<p>First we run&nbsp;<code>git checkout master<\/code>&nbsp;to change the active branch back to master. Then we run the command&nbsp;<code>git merge new-branch<\/code>&nbsp;to merge the new feature into the master<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git checkout master\nSwitched to branch 'master'\n$ git merge new-branch<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Delete a  remote branch <\/span><\/h5>\n\n\n\n<p>You can also delete a branch from your remote repository:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git push origin :&lt;remote-branch-name&gt;\n\n\/\/or \n\n$ git push origin --delete &lt;remote-branch-name&gt;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Delete a local branch in Git<\/span><\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git branch -d &lt;local-branch&gt;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">Undo the last commit<\/span><\/strong><\/h5>\n\n\n\n<p>You made a commit but now you regret it. Maybe you&nbsp;<a href=\"https:\/\/datree.io\/secrets-management-aws\/\">committed secrets<\/a>&nbsp;by accident \u2013 not a good idea \u2013 or maybe you want to add more tests to your code changes. These are all legit reasons to undo your last commit.<\/p>\n\n\n\n<p>And we are 2 ways to it, depending on the situation.<\/p>\n\n\n\n<p>If you want to keep the changes from the commit you want to undo:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git reset --soft HEAD^<\/code><\/pre>\n\n\n\n<p>To destroy the changes from the commit you want to undo:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git reset --hard HEAD^<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/assets.website-files.com\/5d514fd9493b0575f03520bd\/5e38d3ba5db834deeb3caeee_gitcommands-010.PNG\" alt=\"\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Changing a commit message<\/span><\/h5>\n\n\n\n<p>If the commit only exists in your local repository and has not been pushed to GitHub, you can amend the commit message with the<strong>&nbsp;<code>git commit --amend<\/code>&nbsp;<\/strong>command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git commit --amend -m \"new commit message\"<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">D<\/span><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">iff<\/span><\/strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">erences<\/span><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\"> between branches<\/span><\/strong><\/h5>\n\n\n\n<p>When you are working with multiple git branches, it\u2019s important to be able to compare and contrast the differences between two different branches on the same repository. You can do this using the $ git diff command.<\/p>\n\n\n\n<p>Find the diff between the tips of the two branches<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git diff branch_1..branch_2<\/code><\/pre>\n\n\n\n<p>Produce the diff between two branches from common ancestor commit<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git diff branch_1...branch_2<\/code><\/pre>\n\n\n\n<p>Comparing files between branches:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git diff branch1:file branch2:file<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/assets.website-files.com\/5d514fd9493b0575f03520bd\/5e38d3cc7d729a31617e46cc_gitcommands-011.PNG\" alt=\"\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">Change branch name<\/span><\/strong><\/h5>\n\n\n\n<ol><li>Checkout to the branch you need to rename: <strong>$ git checkout &lt;old-name&gt;<\/strong><\/li><li>Rename branch name locally: <strong>$ git branch -m &lt;new-name&gt;<\/strong><\/li><li>Delete old branch from remote: <strong>$ git push origin :&lt;old-name&gt; &lt;new-name&gt;<\/strong><\/li><li>Reset the upstream branch for the new branch name:<strong> $ git push origin -u &lt;new-name&gt;<\/strong><\/li><\/ol>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">pull changes from the Remote<\/span><\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>git pull origin master<\/code><\/pre>\n\n\n\n<p>This will pull changes from the&nbsp;<code>origin<\/code>&nbsp;remote,&nbsp;<code>master<\/code>&nbsp;branch and merge them to the local checked-out branch.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">pull changes from the local branch<\/span><\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>git pull origin\/master<\/code><\/pre>\n\n\n\n<p>will pull changes from the locally stored branch&nbsp;<code>origin\/master<\/code>&nbsp;and merge that to the local checked-out branch. The<strong>&nbsp;<code>origin\/master<\/code><\/strong>&nbsp;branch is essentially a<span class=\"has-inline-color has-vivid-red-color\"> &#8220;cached copy&#8221; <\/span>of what was last pulled from<strong>&nbsp;<code>origin<\/code><\/strong>, which is why it&#8217;s called a remote branch in git parlance. This might be somewhat confusing.<\/p>\n\n\n\n<p>You can see what branches are available with&nbsp;<code>git branch<\/code>&nbsp;and&nbsp;<code><strong>git branch -r<\/strong><\/code>&nbsp;to see the<span class=\"has-inline-color has-vivid-red-color\"> &#8220;remote branches&#8221;<\/span>.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Force &#8220;git pull&#8221; to overwrite local files<\/span> (<span class=\"has-inline-color has-vivid-red-color\"><strong> !!!A revoir !!!<\/strong><\/span>) <\/h5>\n\n\n\n<p>Sometimes, we just want to force an overwrite of local files on a&nbsp;<code>git pull<\/code>.  <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ First, run a fetch to update\n\/\/ all origin\/&lt;branch&gt; refs to latest:\ngit fetch --all\n\n\/\/ optional we can make git branch -r, to see\n\/\/ the locally \"remote branches\" (cached copy\") \n\n\/\/ then \ngit reset --hard origin\/&lt;branch_name&gt;\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">the<strong>&nbsp;<code>git reset<\/code><\/strong>&nbsp;resets the current branch you are working on.\nThe<strong>&nbsp;<code>--hard<\/code><\/strong>&nbsp;option changes all the files in your working tree\n to match the files in<strong>&nbsp;<code>origin\/&lt;branch_name&gt;<\/code><\/strong><\/pre>\n\n\n\n<p><strong>*Backup before resetting<\/strong> : It&#8217;s worth noting that it is possible to maintain current local commits by creating a branch from&nbsp;<code>master<\/code>&nbsp;before resetting:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git checkout master\ngit branch new-branch-to-save-current-commits\ngit fetch --all\ngit reset --hard origin\/master<\/code><\/pre>\n\n\n\n<p>After this, all of the old commits will be kept in&nbsp;<strong><code>new-branch-to-save-current-commits<\/code>.<\/strong>  <\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Fixing issues-commit message<\/span><\/h5>\n\n\n\n<p>You can link a pull request to an issue by using a supported keyword in the pull request&#8217;s description or in a commit message (please note that the pull request must be on the default branch).<\/p>\n\n\n\n<ul><li>close<\/li><li>closes<\/li><li>closed<\/li><li>fix<\/li><li>fixes<\/li><li>fixed<\/li><li>resolve<\/li><li>resolves<\/li><li>resolved<\/li><\/ul>\n\n\n\n<p>for example: to link an issue with id=10<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git commit -m \"fixes #28\"<\/code><\/pre>\n\n\n\n<p>The syntax for closing keywords depends on whether the issue is in the same repository as the pull request.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>inked issue<\/th><th>Syntax<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td>Issue in the same repository<\/td><td><em>KEYWORD<\/em>&nbsp;#<em>ISSUE-NUMBER<\/em><\/td><td><code>Closes #10<\/code><\/td><\/tr><tr><td>Issue in a different repository<\/td><td><em>KEYWORD<\/em>&nbsp;<em>OWNER<\/em>\/<em>REPOSITORY<\/em>#<em>ISSUE-NUMBER<\/em><\/td><td><code>Fixes octo-org\/octo-repo#100<\/code><\/td><\/tr><tr><td>Multiple issues<\/td><td>Use full syntax for each issue<\/td><td><code>Resolves #10, resolves #123, resolves octo-<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">&nbsp;<\/span><\/h5>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Find Latest Git Tag Available<\/span><\/h5>\n\n\n\n<p>In order to find the latest Git tag available on your repository,&nbsp;<strong>you have to use the \u201cgit describe\u201d command with the \u201c\u2013tags\u201d option.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git describe --tags<\/code><\/pre>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\"><strong>Tagging<\/strong> a project<\/span><\/h5>\n\n\n\n<p>You can use&nbsp;<strong>tagging<\/strong>&nbsp;to mark a significant change you made, such as a release.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git tag 1.0.0 &lt;commit_id&gt;<\/code><\/pre>\n\n\n\n<p>or  we can make it simple way, with annotated Tag: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git tag -a v1.4 -m \"my version 1.4\"\n$ git tag\nv0.1\nv1.3\nv1.4<\/code><\/pre>\n\n\n\n<p>The&nbsp;<code>-m<\/code>&nbsp;specifies a tagging message, which is stored with the tag. If you don\u2019t specify a message for an annotated tag, Git launches your editor so you can type it in.<\/p>\n\n\n\n<p>You can see the tag data along with the commit that was tagged by using the&nbsp;<code>git show<\/code>&nbsp;command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git show v0.0.2\ntag v0.0.2\nTagger: Brice Nguenkam &lt;brice.nguenkam@vipco.de&gt;\nDate:   Sun Feb 21 23:02:06 2021 +0100\n\nupgrade patch version\n\ncommit 3c659c6c1cd25b6150311c7bad0dfbf032a5fb31 (HEAD -&gt; master, tag: v0.0.2, origin\/master)\nAuthor: Brice Nguenkam &lt;brice.nguenkam@vipco.de&gt;\nDate:   Sun Feb 21 23:02:06 2021 +0100\n\n    upgrade patch version\n<\/code><\/pre>\n\n\n\n<p>That shows the tagger information, the date the commit was tagged, and the annotation message before showing the commit information.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Checkout latest Git tag<\/span><\/h5>\n\n\n\n<p>In order to checkout the latest Git tag, first update your repository by fetching the remote tags available.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git fetch --tags\n\n\nFetching origin\nFrom git-repository\n   98a14be..7a9ad7f  master     -&gt; origin\/master\n * &#91;new tag]         v2.0       -&gt; v2.0\n * &#91;new tag]         v1.0       -&gt; v1.0<\/code><\/pre>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Sharing Tags<\/span><\/h5>\n\n\n\n<p>By default, the&nbsp;<code>git push<\/code>&nbsp;command doesn\u2019t transfer tags to remote servers. You will have to explicitly push tags to a shared server after you have created them. This process is just like sharing remote branches : ?you can run&nbsp;<code>git push origin &lt;tagname&gt;<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git $ git push origin v1.5\nCounting objects: 14, done.\nDelta compression using up to 8 threads.\nCompressing objects: 100% (12\/12), done.\nWriting objects: 100% (14\/14), 2.05 KiB | 0 bytes\/s, done.\nTotal 14 (delta 3), reused 0 (delta 0)\nTo git@github.com:schacon\/simplegit.git\n * &#91;new tag]         v1.5 -&gt; v1.5<\/code><\/pre>\n\n\n\n<p>If you have a lot of tags that you want to push up at once, you can also use the&nbsp;<code>--tags<\/code>&nbsp;option to the&nbsp;<code>git push<\/code>&nbsp;command. This will transfer all of your tags to the remote server that are not already there.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git push origin --tags<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Deleting Tags<\/span><\/h5>\n\n\n\n<p>To delete a tag on your local repository, you can use&nbsp;<code>git tag -d &lt;tagname&gt;<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git tag -d v1.4-lw\nDeleted tag 'v1.4-lw' (was e7d5add)<\/code><\/pre>\n\n\n\n<p>Note that this does not remove the tag from any remote servers. There are two common variations for deleting a tag from a remote server.<\/p>\n\n\n\n<p>The best (and more intuitive) way to delete a remote tag is with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git push origin --delete &lt;tagname&gt;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Checking out Tags<\/span><\/h5>\n\n\n\n<p>If you want to view the versions of files a tag is pointing to, you can do a&nbsp;<code>git checkout<\/code>&nbsp;of that tag, although this puts your repository in \u201cdetached HEAD\u201d state, which has some ill side effects:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git checkout v2.0.0\nNote: switching to 'v2.0.0'.\n\nYou are in 'detached HEAD' state. You can look around, make experimental\nchanges and commit them, and you can discard any commits you make in this\nstate without impacting any branches by performing another checkout.\n\nIf you want to create a new branch to retain commits you create, you may\ndo so (now or later) by using -c with the switch command. Example:\n\n  git switch -c &lt;new-branch-name&gt;\n\nOr undo this operation with:\n\n  git switch -\n\nTurn off this advice by setting config variable advice.detachedHead to false\n\nHEAD is now at 99ada87... Merge pull request #89 from schacon\/appendix-final\n\n$ git checkout v2.0-beta-0.1\nPrevious HEAD position was 99ada87... Merge pull request #89 from schacon\/appendix-final\nHEAD is now at df3f601... Add atlas.json and cover image<\/code><\/pre>\n\n\n\n<p>In \u201cdetached HEAD\u201d state, if you make changes and then create a commit, the tag will stay the same, but your new commit won\u2019t belong to any branch and will be unreachable, except by the exact commit hash. Thus, if you need to make changes?\u2014?say you\u2019re fixing a bug on an older version, for instance?\u2014?you will generally want to create a branch:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git checkout -b version2 v2.0.0\nSwitched to a new branch 'version2'<\/code><\/pre>\n\n\n\n<p>If you do this and make a commit, your&nbsp;<code>version2<\/code>&nbsp;branch will be slightly different than your&nbsp;<code>v2.0.0<\/code>&nbsp;tag since it will move forward with your new changes, so do be careful.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Log- Listing of commits<\/span><\/h5>\n\n\n\n<p>It shows a&nbsp;<strong>listing of commits<\/strong>&nbsp;on a branch with corresponding details.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$git log\n\n\/\/or for a contracted form \n\n$git shortlog<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"673\" height=\"358\" src=\"https:\/\/nguenkam.com\/blog\/wp-content\/uploads\/2021\/02\/image-5.png\" alt=\"\" class=\"wp-image-895\" srcset=\"https:\/\/nguenkam.com\/blog\/wp-content\/uploads\/2021\/02\/image-5.png 673w, https:\/\/nguenkam.com\/blog\/wp-content\/uploads\/2021\/02\/image-5-300x160.png 300w\" sizes=\"(max-width: 673px) 100vw, 673px\" \/><\/figure>\n\n\n\n<p>The&nbsp;<strong>git shortlog<\/strong>&nbsp;command is a special version of&nbsp;<strong>git<\/strong>&nbsp;log intended for creating release announcements. It groups each commit by author and displays the first line of each commit message. This is an easy way to see who&#8217;s been working on what.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git shortlog\nBrice Nguenkam (7):\n      first init\n      initial commit 11.11.2020\n      first init\n      modify expertise role ( typescripter)\n      0.0.1\n      upgrade to angular version 11\n      upgrade patch version\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">&nbsp;List the files tracked on the current branch<\/span><\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git ls-tree -r master<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"584\" height=\"109\" src=\"https:\/\/nguenkam.com\/blog\/wp-content\/uploads\/2021\/02\/image-1.png\" alt=\"\" class=\"wp-image-859\" srcset=\"https:\/\/nguenkam.com\/blog\/wp-content\/uploads\/2021\/02\/image-1.png 584w, https:\/\/nguenkam.com\/blog\/wp-content\/uploads\/2021\/02\/image-1-300x56.png 300w\" sizes=\"(max-width: 584px) 100vw, 584px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Remove a file from git tracking (git status )<\/span><\/h5>\n\n\n\n<p>The easiest way to delete a file in your Git repository is to execute the \u201cgit rm\u201d command and to specify the file to be deleted.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git rm &lt;file&gt;\n\n$ git commit -m \"Deleted the file from the git repository\"\n\n$ git push<\/code><\/pre>\n\n\n\n<p>&nbsp;you will also have to commit your changes, \u201cgit rm\u201d does not remove the file from the Git index unless you commit it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Note that by using the \u201c<strong>git rm<\/strong>\u201d command, the file will also be\ndeleted from the filesystem. If you dont want to delete it from\nthe filesystem, then use the option <code>--cached<\/code>.\n( git rm <code>--cached<\/code> &lt;file&gt; )<\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\"> Remove a folder from git tracking (git status ) <\/span><\/h5>\n\n\n\n<p>How to remove a folder from git repository without deleting it from the local machine (i.e., development environment)?<\/p>\n\n\n\n<p><span class=\"has-inline-color has-vivid-red-color\"><strong>Step 1.<\/strong><\/span> Add the folder path to your repo&#8217;s root&nbsp;<code>.gitignore<\/code>&nbsp;file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/example: \/node_modules\npath_to_your_folder\/<\/code><\/pre>\n\n\n\n<p><span class=\"has-inline-color has-vivid-red-color\"><strong> Step 2.<\/strong><\/span> Remove the folder from your local git tracking, but keep it on your disk.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ example: git rm -r --cached node_modules\ngit rm -r --cached path_to_your_folder\/<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">the option -r is put for \"recursively\", because a folder contains many files.<\/pre>\n\n\n\n<p><span class=\"has-inline-color has-vivid-red-color\"><strong> Step 3.<\/strong><\/span> Push your changes to your git repo.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">The folder will be considered \"deleted\" from Git's point of view\n(i.e. they are in past history, but not in the latest commit,\nand people pulling from this repo will get the files removed\nfrom their trees), but stay on your working directory because\nyou've used&nbsp;<code>--cached<\/code>.<\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Revert\/ Undo&nbsp;<code>\"git add<\/code> &#8221;&nbsp; <\/span><\/h5>\n\n\n\n<p>You can undo&nbsp;<code>git add<\/code>&nbsp;before commit with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git reset &lt;file&gt;<\/code><\/pre>\n\n\n\n<p>which will remove it from the current index (the &#8220;about to be committed&#8221; list) without changing anything else.<\/p>\n\n\n\n<p>You can use it without any file name to unstage all due changes<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git reset<\/code><\/pre>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5><span class=\"has-inline-color has-vivid-cyan-blue-color\">Return to a previous commit<\/span><\/h5>\n\n\n\n<p>To jump back to a previous commit, first find the commit&#8217;s hash using&nbsp;<a href=\"https:\/\/riptutorial.com\/git\/topic\/240\/browsing-the-history\"><code>git log<\/code><\/a><\/p>\n\n\n\n<p><em><strong>To temporarily jump back to that commit, detach your head with:<\/strong><\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git checkout 789abcd<\/code><\/pre>\n\n\n\n<p>This places you at commit&nbsp;<code>789abcd<\/code>. You can now make new commits on top of this old commit without affecting the branch your head is on.<\/p>\n\n\n\n<p><em><strong>To roll back to a previous commit while keeping the changes:<\/strong><\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git reset --soft 789abcd<\/code><\/pre>\n\n\n\n<p><em><strong>To roll back the&nbsp;<span class=\"has-inline-color has-vivid-red-color\">last<\/span>&nbsp;commit:<\/strong><\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git reset --soft HEAD~<\/code><\/pre>\n\n\n\n<p><em><strong>To permanently discard any changes made after a specific commit, use:<\/strong><\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git reset --hard 789abcd<\/code><\/pre>\n\n\n\n<p><em><strong>To permanently discard any changes made after the&nbsp;<span class=\"has-inline-color has-vivid-red-color\">last&nbsp;<\/span>commit:<\/strong><\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git reset --hard HEAD~<\/code><\/pre>\n\n\n\n<p><strong>Beware:<\/strong>&nbsp;While you can&nbsp;recover the discarded commit using <em><strong>reflog <\/strong><\/em>and <em><strong>reset<\/strong><\/em> , uncommitted changes cannot be recovered. Use&nbsp;<em><span class=\"has-inline-color has-vivid-red-color\">git stash; git reset<\/span><\/em>&nbsp;instead of&nbsp;<em><span class=\"has-inline-color has-vivid-red-color\"><code>git reset --hard<\/code>&nbsp;<\/span><\/em>to be safe.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>$git config You can use it to&nbsp;configure&nbsp;the author&#8217;s name, email address, file formats and many more to be used with your commits. $git init Using this command you make it sure that your&nbsp;git repository&nbsp;is initialized and creates the initial&nbsp;.git&nbsp;directory in a new or in an existing project. The output will be the following: You can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":807,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[60],"tags":[93,95,61],"_links":{"self":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/772"}],"collection":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=772"}],"version-history":[{"count":34,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/772\/revisions"}],"predecessor-version":[{"id":2806,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/772\/revisions\/2806"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/807"}],"wp:attachment":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}