Git - the lesser known Source Code Manager

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

#1

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.

Branches

Within a local copy of the repository.

git branch -a
   remotes/origin/HEAD
   remotes/origin/foo
   remotes/origin/bar
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 192.168.1.0/24 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: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# 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
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser