If you run a command that produces a lot of output in a Git Bash and you try to scroll up to the beginning of that output, you may see that it has been truncated. The number of lines that can be displayed in the Git Bash is controlled by a scrollback buffer size (10000 […]
git
Git Bash: Install jq
jq is a command-line tool for parsing a JSON data (like grep or sed for a text data). You can use the jq command on Windows using a Git Bash, but firstly it has to be installed as it is not among the default tools. This note shows how to install the jq for the […]
Git: Migrate Repository
If you want to move from one Git server to another, you will need to migrate your Git repositories. This note shows how to migrate a Git repository with all its history, branches and tags from one Git server to another. This method is simple, straightforward and can be used to move you Git repository […]
Git: Create Empty Branch
By default, the commands git branch <newBranchName> and git checkout -b <newBranchName> create a new branch from the current one. This means that the new branch will be based on your currently checked out (HEAD) branch, i.e. will contain all the files and commits from the parent branch. Let’s assume that you want to create […]
Git Bash: Clear History
The history -cw command is used to clear a Bash history on Linux, but for some reason it doesn’t work for a Git Bash on Windows. If you try to clear the commands history in the Git Bash using this command, it won’t work – you will still see the history of the executed commands […]
Git: Show Remote URL & Check Origin
Remotes in Git are simply aliases that store the URLs of repositories. By convention, an origin is the alias of the default remote repository where you publish your commits. In Git you can work with several remotes with different aliases. From this note you will find out how to show the configured remote URLs of […]
Create GitLab Project/Repository from Command Line
In GitLab you can create a new project/repository not only through a user interface, but also from the command line. When you create a new local Git repository and then push it to GitLab, if this repository doesn’t exit there, the corresponding project for it will be created automatically. This short note shows how to […]
Git: Show Ignored Files
A .gitignore file specifies the files that Git should ignore. Sometimes you may need to list all the files that Git should ignore. In this short note i will show 2 methods of how to list ignored files in Git.
GitLab CI/CD: Trigger Pipeline Manually & API
By default, GitLab CI/CD pipelines are executed automatically on pushing new commits to a repository and don’t require any intervention once created. However, there are also times when you need to trigger pipelines manually, without updating the project. In this note i will show how to trigger the GitLab CI/CD pipelines manually through the GitLab’s […]
GitLab CI/CD: Build Docker Image & Push to Registry
GitLab CI/CD can be used with Docker to build Docker images. For example, you can create a Docker image of your application and push it to a GitLab’s Container Registry. In this note i am showing an example of how to create a new repository in GitLab with a CI/CD pipeline that will be used […]