Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Git



  Frequently used Git commands

Git configuration git config --global user.name "robbin" git config --global user.email "fankai@gmail.com" git config --global color.ui true git config --global alias.co checkout git config --global alias.ci commit git config --global alias.st status git config --global alias.br branch git config --global core.editor "mate -w" # Configure Editor to use textmate git config -l #List all configurations User's git configuration file : ~/.gitconfig Frequently used Git commands Check、add...

   Git,Command     2013-03-11 19:41:06

  Fix could not read Username for 'https://xxx.com': terminal prompts disabled

Recently was working on a project which needed to build a docker image, but unfortunately it kept failing as below error was seen. fatal: could not read Username for 'https://xxx.com': terminal prompts disabled Based on the error, it looked like it was trying to pull code from remote Gitlab repository but failed as the terminal prompt is disabled. At first glance, have a doubt why it needs terminal prompt to be enabled? It should just succeed and without prompting for anything. The only reason...

   GIT,TERMINAL PROMPTS DISABLED,DOCKER     2020-12-13 04:43:12

  git reset vs git revert

When maintaining code using version control systems such as git, it is unavoidable that we need to rollback some wrong commits either due to bugs or temp code revert. In this case, rookie developers would be very nervous because they may get lost on what they should do to rollback their changes without affecting others, but to veteran developers, this is their routine work and they can show you different ways of doing that. In this post, we will introduce two major ones used frequently by develo...

   GIT,GIT RESET,GIT REVERT     2019-02-02 08:26:39

  How to undo git changes?

When using git for version control, there is frequent need on undoing commits due to some unexpected changes. This post will introduce how to undo changes with git command in different cases. Undo commit A common undo case is that some commit needs to be reverted as the commit contains error. In this case, the code is already committed. The command to revert the commit is git revert HEAD This command will add new a commit to the existing head to undo the previous commit. It will not change the p...

   GIT,GIT RESET,GIT REVERT,GIT CHECKOUT     2019-12-28 02:21:47

  Useful git commands in daily work

In a developer's daily work, it is frequent to see lots of commits made. It would be a headache if one cannot use git commands well especially when in cases where some fixes need to be made on existing branches. There are some frequently used command such as git pull, git merge and git push. Apart from these, there are some other practical commands which may be useful for real use cases. This post will try to list some of them. git grep  It will lists all files containing the searched keywo...

   GIT,GIT COMMAND,GIT LOG     2022-05-01 03:17:15

  Ways to undo wrong Git operations

While using Git to version code, programmers would inevitably perform some invalid operations which are not expected. Sometimes it's difficult to deal with this kind of awkward situations. If the programmer chooses to undo the operation, the programmer needs to bear the risk of deleting something which is not supposed to be deleted if the undo is done improperly. If the programmer leaves it as is, the file needs to be updated again manually with a new commit. In this post, we will try to pr...

   GIT,GIT COMMIT,GIT RESET     2018-07-07 03:28:21

  Simple tutorial on git cherry-pick

It is a common operation to move code from one branch to another branch in a multi-branch git repository. Normally there are two scenarios: Want to move all changes in one branch to another branch, now it's called git merge  Want to move only some change/changes from one branch to another branch, now it's called git cherry-pick Usage The purpose of git cherry-pick is to apply some change from one branch to another branch.  git cherry-pick [commitHash] The above command is to app...

   GIT,GIT CHERRY-PICK,TUTORIAL     2020-05-02 00:02:58

  Linux Kernel is replacing HTTP link with HTTPS

Linux kernel is in the process of replacing the HTTP links in its source code with HTTPS links. HTTPS is considered more secure than HTTP and can prevent lots of attacks like Man-In-The-Middle attack.  Currently there are more than 150 patches submitted by Linux Kernel developers to replace these HTTP links.  One thing to be noted is this replacement process is not a manual search and replace process. Indeed, some scripts are created to find out these links and try to find whethe...

   LINUX KERNEL,HTTP,HTTPS     2020-08-08 01:35:20

  Resolve git issue git@github.com: Permission denied (publickey)

Sometimes when clone a remote repository from github.com, you may see below error. D:\Project\Playground\GitBisect>git clone git@github.com:bradleyboy/bisectercise.git Cloning into 'bisectercise'... git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. The issue occurs when there is no key on your machine which is associated with your github account. To fix the issue, please ...

   GIT,GITHUB,PERMISSION DENIED,PUBLIC KEY     2019-07-12 10:10:49

  A simple example of git bisect command

git bisect is a very powerful command for finding out which commit is a bad commit when bug occurs.  The rationale behind this command is that it pin locates the bad commit by divide and conquer. It divides the commit history into two equal parts, then determines whether the bad commit is at the first half or at the other half. This process will continue until the bad commit is located. Here is a really good example created by bradleyboy, this is a simple git repository which demonstr...

   GITHUB,GIT,GIT BISECT     2019-07-12 10:31:51