Articles
Practical guides to Git, the vi editor and web development that I wrote while working as a software engineer. Each one answers a single question with the commands you need.
Git
- How to delete a branch in Git (local and remote)
Delete Git branches you no longer need: locally with git branch -d / -D and on the remote with git push -d origin <branch>.
- Git force push: what it does and when to use it
The push command refuses to update a remote ref that isn't an ancestor of the local ref. These checks can be disabled by force pushing. In this article, you will learn what force pushing is and which consequences it might have.
- The Git Push Command
The Git push command is used to upload your committed changes to the server. In this article, you will learn about the Git push command and how to use it.
- The Git Add Command
With the add command, you add file contents to the index. In this article, you will learn how to use the add command and get to know its behavior.
- The Git Commit Command
Committing your changes can be done in several ways. In this article, you will learn which ways are possible when using the commit command.
- How to check out a file from a specific commit in Git
Sometimes you want to check out file as it was on another commit. In this article, you will learn how you can do this easily by using the Git checkout command.
- How to stash changes with a message in Git
Stashing is useful to save your local changes away. Over time it can get messy and you won't know what all your stashes contain. In this article, you will learn how to add a description to your stashes to keep track of what changes they contain.
- How to pull from a different branch in Git
Pull another branch, e.g. the remote main, into the branch you are on — or into a different local branch — by naming the source and target in git pull.
- How to push to a different remote branch in Git
It might happen that you create commits on the wrong local branch. However, it is still possible to push to another remote branch than the remote tracking branch of your current branch. In this article, you will learn how to use the Git push command to push to a different remote branch than the one you made your commits on.
- Git cherry-pick: apply a single commit to another branch
Cherry picking is a useful command to apply only certain commits. In this article, you will learn how to use this useful command.
- Using Git with SSH Keys
SSH is a network protocol which is used for remote communication between machines. In this article, you will learn how to create and use SSH keys for your Git repository.
- The Git Stash Command
The Git stash command is useful if you are working on something but need to work on something else instantly without finishing you current work. In this article, you will learn how to use the stash command to stash your changes, to manage your stashes, and to recover your stashes later properly.
- How to create a new branch in Git
In Git you are working on branches. You can create them, switch between them and delete them. In this article, you will learn about branches in Git and how to create new ones.
- The Git Revert Command
It might happen that you want to undo a commit other than the latest one. In this article, you will learn how to achieve this by using the Git revert command.
- How to stash a single file or directory in Git
With Git you can stash all changed files, a specific directory, or a specific file. In this article, you will learn how to stash your whole working directory, a specific directory, or a specific file.
- How to recover a deleted file in Git
It might happen that you delete a file by accident. Git can help you to recover it. In this article, you will learn how to do this by using the Git checkout command.
- How to abort a merge in Git (git merge --abort)
Merge conflicts and no time to resolve them? Abort the merge with git merge --abort or git reset --merge and get back to the state before the merge.
- What is HEAD in Git? HEAD, HEAD~1 and HEAD~n explained
HEAD is the commit you have checked out. Learn what HEAD, HEAD~1 and HEAD~n mean in Git and where you use them, e.g. with git reset.
- How to undo commits with git reset
Understand the Git reset command to undo commits while keeping your local changes (soft reset) or while reverting them (hard reset). In this article, you will learn the difference between soft and hard reset and how to use them.
- How to rename a branch in Git
You might want to rename a branch which you already pushed to remote or to rename a branch which you only have locally. In this article, you will learn how to rename a branch.
- Git tags: how to create, push and check out tags
Tagging means creating a named commit. It gives you the possibility to jump to a commit by using its name instead of its hash value. In this article, you will learn how to use the Git Tag command.
- What is Git and how do I use it?
Git is a Version Control System. In this article, you will learn the basics of Git which is widely used in professional software development. In this article, you will learn what Git is and how to use it.
vi & the command line
- Replacing text, lines and characters in vi
Sometimes, you don't want to insert new text into a file but instead replace a letter, a word, or a text sequence. Vi provides some handy commands to do such replacements. Let's have a look at them!
- How to search in vim
Navigating through files in Vim can be tricky without the right tools. In this guide, we’ll cover the essential Vim search techniques to help you find what you need quickly and efficiently!
- Navigating within text blocks in vi
It's nice to know how to navigate within a line or word by word in vi and vim. However, it's still not the fastest way to navigate within vi and vim. It still might take a while to navigate to the desired line. Therefore, we want to have a look at how to navigate within text blocks (sentences and paragraphs) in this article. Additionally, we will get to know the "go to" command to quickly navigate to a specific line as well as to the beginning or end of the file.
- How to show line numbers in vi and vim
Show line numbers in vi and vim with :set number, hide them again with :set nonumber, or turn them on for every file in your .vimrc.
- Moving the cursor within a line and between lines in vi
When working with an editor, it makes sense how to navigate within it properly. Moving the cursor by single characters may sound easy at first sight. You might think just using the arrow keys is sufficient and with that you might be right. In theory. Vi enables us to move the cursor by multiple characters, too. But: This is not possible using the arrow keys. In this article, you will learn how to move the cursor character by character and by multiple characters at once.
- Moving the cursor word by word in vi
We already learned how to navigate character by character in vi. Navigating word by word can be a time-saver compared to moving character by character, and can also help you work more efficiently. In this article, we will have a look at the six commands for moving word by word. Mastering these commands is a great way to take your productivity to the next level.
- Moving the cursor character by character in vi
When working with an editor, it makes sense how to navigate within it properly. Moving the cursor by single characters may sound easy at first sight. You might think just using the arrow keys is sufficient and with that you might be right. In theory. Vi enables us to move the cursor by multiple characters, too. But: This is not possible using the arrow keys. In this article, you will learn how to move the cursor character by character and by multiple characters at once.
- How to close vi: save and quit, or quit without saving
How to exit vi and vim: save and quit with :wq, quit without saving with :q!, and close several open files at once.
- The two modes of vi: command mode and insert mode
Working with vi can be pretty confusing at first. You finally managed to open a file, start typing but your text does not appear on the screen. Strange. You probably did not enter insert mode yet. In this article, you will learn about the different modi in vi and how to switch between them.
- How to kill a process in one line in the terminal
Don't we all know the situation: We start a service and the command line says 'Address already in use'. Let's learn how to kill a process blocking a specific port in just one line.
- How to open a file in vi
Sometimes you have to work on the command line and don't have a text editor with a UI available. The text editors which are available on the command line most of the time are vi and nano. So, you better are prepared to be able to use one of them in case that you don't have the possibility to use your favourite text editor. In this article, you will learn how to open a file using vi.
- vi basics: edit a file, save and exit
Sometimes you have to work on the command line and don't have a text editor with a UI available. The text editors which are available on the command line most of the time are vi and nano. So, you better are prepared to be able to use one of them in case that you don't have the possibility to use your favourite text editor. In this article, you will learn the basics of the text editor vi.
Web development
- The CSS :is() Pseudo Class
I got to know the :is() pseudo class when coding The High Five Network. I used it almost everywhere right away. As I now understand how and when to use the :is() pseudo class, I also know that this heavy usage led to usages which do not make sense. In this article, I want to explain how and when to use the :is() pseudo class.
- Updating numeric values with transactions in Firebase Realtime Database
I am thinking a lot about my personal projects. When thinking about The High Five Network recently, I figured that I am using the locally cached value of likes of an achievement when someone gives a high five for an achievement which can result in likes being not counted properly. In this article, I would like to show you how you increase a counter properly using transactions in Firebase Realtime Database.
- What is the JavaScript Spread Operator?
The JavaScript Spread Operator allows you to spread the elements of an array or an object. This is pretty useful to create exact copies of objects or arrays, easily. In this article, you will learn what the JavaScript Spread Operator is, how you can use it and how you can benefit from using the JavaScript Spread Operator.
- What is JSON?
JSON stands for JavaScript Object Notation. It is a data format which needs way less space than XML. This keeps the needed traffic of web applications low and therefore JSON is used extensively in web applications. In this article, you will learn how JSON is structured.
Agile
- What is Scrum?
Scrum is an agile process model. The idea behind is to be able to react to wishes of the customer very fast to ensure a successful project. In this article, you will learn how the Scrum process works.