Move a subdirectory into a new git repository

Print Friendly, PDF & Email

Context In the real world, we may probably have a large Git repository where you want to move out some sub-directories into single Git repositories. Regarding the Git repository, we…

Undo the last commit

Print Friendly, PDF & Email

As a software engineer or developer, I am pretty sure we often use git in our work on a daily basis. Many commits are committed to your local or remote…

Create or update a commit by a specified author

Print Friendly, PDF & Email

You may have a situation where a repository is mirrored to multiple remote URLs. One of the URLs is on Bitbucket and the other one is based on GitLab for…

Create an empty commit

Print Friendly, PDF & Email

When updating a submission, a new revision will be created to capture the updates and a commit will also be created. However, some updates don’t change the files coming alongside the submission but edited some metadata on that submission/dataset. In this case, an empty commit is created to match the newly created version.

Exceptions in a .gitignore file

Print Friendly, PDF & Email

You can tell Git to ignore some files or directories using a pattern. However, there are some exceptions we don’t want miss files which are matched to the pattern. In…

Add git branch name to bash prompt

Print Friendly, PDF & Email

By default, git won’t display branch name to terminal prompt. To know which branch you are in, just run git branch command. However, if you want to customise how to…

Git shows files come along a specific commit

Print Friendly, PDF & Email

Sometimes we need to check which files were come along with a given commit so as to verify which is the missing file, for instance. I bet some of you…

Git tutorials

Print Friendly, PDF & Email

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn and has a tiny footprint with lightning fast performance.

How to upload a new project to a remote Git repository

Print Friendly, PDF & Email

I often forget how to upload a new project to a remote Git repository because that is rarely done. Thus I need to summarise the essential steps of this operation…