SEARCH KEYWORD -- GIT COMMAND
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
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...
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
Undoing Changes in Git: Working Directory, Staging Area, and Committed Changes
When working with Git, it's crucial to understand how to undo changes at different stages—whether in the working directory, the staging area, or after committing changes to the local repository. This guide walks you through the essential Git commands to effectively manage and revert changes, ensuring that your version control process is smooth and error-free. Modifying Files in the Working Directory but Not Yet Added to the Staging Area When you make changes to files in your working direct...
GIT RESET,STAGING AREA,UNDO CHANGE 2024-08-11 08:53:34
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
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
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
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
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
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
RECENT
- EtsiosApp Release Date: All You Need to Know
- SIEM Big Data Visualization [03]:Graph-Based SIEM Log Analysis Dashboard
- How AI is Changing Web Development: A New Era of Digital Innovation
- SIEM Big Data Visualization [02]: National Cyber Threats Dashboard
- Exploring the Impact of a Loan Origination System on Financial Institutions
- Power Grid OT Simulation System
- Why is Golang's Compilation Speed So Fast?
- SIEM Big Data Visualization : Dashboard for Monitoring Scam Events in Critical Infrastructure
- Introduction to the Application of eBPF in Golang
- Flows.network: Writing an LLM Application in Rust
- more>>