Git is a popular version control system and can monitor and edit changes to code projects and manage their return. Let's take a look at the most commonly used git commands below. Then we can step into more complex commands.

Basic Stuff

git init: Used to create a Git repository.

git clone: Used to create a clone of a Git repository.

git add: Used to report local changes to Git.

git commit: Used to commit local changes to the Git repository.

git push: Used to push local changes to a Git server.

git pull: Used to pull changes from a Git server to its local repository.

git branch: Used to view the tree structure in the Git repository and create a new branch.

git merge: Used to merge two or more branches.

git status: Used to view the status of files in the repository.

git log: Used to view the commit history in the repository.

This list contains only a few of Git's most important commands, but the majority of these commands are frequently used in everyday Git use. Let's take a step towards more specific commands about git commands.

The best way to find out is to create an empty repo and simulate it as if you are working with others on different computers with different file formats. Work from different computer in the file you are working on, send commits at different times and eat conflict :) If you make things a little more difficult after your first conflict experience, you will realize that it starts to get easier.

How crowded is it?

Free accounts on Git platforms such as Github, Gitlab, Bitbucket have limitations such as file limit. If you are looking for a command line method to find out the size of your GitHub repository, you can try the following commands:

git count-objects -vH

This command will show the sizes of the files in your repository and how many files there are. For example, the output might show something like "size-pack: 214.50 MiB", which means the total size of your repository is 214.50MB.

du -sh

This command is not a git command, it is a linux command, but if you are running on a remote server or *nix system, it will show the total size of the directory (and its subdirectories) you are in. After running this command, you can see the size of your repository if you are in the directory where the clone of your repository is located. For example, the output might be displayed as something like "4.0K", which means your repository is 4KB in size.

Let's sponge on the past

You accidentally tried to post a very large backup of yours on github. When you do git push remote: error: File ugurakcil.tar.gz is 235.20 MB; You get errors like this exceeds GitHub's file size limit of 100 MB. You keep getting the error even though you deleted the file.

git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch ugurakcil.tar.gz' HEAD

You need to delete the file related to this command from your git history. If the file is not in the main directory but in subfolders, you must specify it with its full path, such as storage/backups/mylovelygreatfiles.zip.

To be continued..