Git - the lesser known Source Code Manager

Tags: #<Tag:0x00007f0ca7e73938> #<Tag:0x00007f0ca7e737f8>


Git wiki

Git was one of the side projects of Linus Torvalds, and became the de-facto successor of SVN, Mercurial and others. Primarily because it allowed to commit local changes, and to merge the branches. Besides that it seems simple, until you run into one of the following issues.


Within a local copy of the repository.

git branch -a
git checkout foo
# after the works
git checkout master

Gets you to the remotes/origin/foofoo feature branch.

This gets tied to feature / issue branches and open tasks with GitLab / GitHub / JIRA.

Self-signed TLS / SSL certs

I use an internal GitLab server at a IP address. I don’t run my own CA for my lab’s GitLab CE.

git -c http.sslVerify=false clone https://192.168.1.X/marius/osquery_th.git
Cloning into 'osquery_th'...
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 8 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (8/8), done.

git config http.sslVerify false

Remove remote .idea folder, keep local only

Yes, yes… once you accidentally committed the .idea (or other IDE files), you meet new fellow devs. In order to help them, here is the recipe.

git rm -r --cached .idea
rm '.idea/.name'
rm '.idea/compiler.xml'
rm '.idea/encodings.xml'
rm '.idea/misc.xml'
rm '.idea/vcs.xml'

Check local files:

ls -alt | grep idea
drwxr-xr-x   8 wishi  staff   256  1 Dez 17:33 .idea

Ok, they are still here. Now we can adapt our .gitignore:

# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference:

# User-specific stuff

# Generated files

# Sensitive or high-churn files

# Gradle

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn.  Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules

# CMake

# Mongo Explorer plugin

# File-based project format

# IntelliJ

# mpeltonen/sbt-idea plugin

# JIRA plugin

# Cursive Clojure plugin

# Crashlytics plugin (for Android Studio and IntelliJ)

# Editor-based Rest Client

# Android studio 3.1+ serialized cache file