checkout a specific tag
git co tags/1.5.0.0
fetch tags
git fetch --tags
EmbeddedDatabase db = new EmbeddedDatabaseBuilder() | |
.generateUniqueName(true) | |
.setType(H2) | |
.setScriptEncoding("UTF-8") | |
.ignoreFailedDrops(true) | |
.addScript("schema.sql") | |
.addScripts("user_data.sql", "country_data.sql") | |
.build(); | |
// perform actions against the db (EmbeddedDatabase extends javax.sql.DataSource) |
this git-command changes an existing remote repository URL
git remote set-url <https://github.com/USERNAME/REPO.git>
If you want to move an existing git repo to a new remote location. First, checkout the required repo with all the branches you want to migrate
[user] | |
name = Florian Roeser | |
email = [email protected] | |
[core] | |
editor = vim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile = ~/.gitignore | |
[web] | |
browser = google-chrome | |
[instaweb] |
# Case: | |
# The git-repo is enourmous an we want to drop a part of the history | |
# or, if we split a monolithic application, and the "new" application emerging from it should only have a few commits and not the whole history. | |
# | |
git checkout --orphan temp $1 # create a new branch without parent history | |
git commit -m "Truncated history" # create a first commit on this branch | |
git rebase --onto temp $1 master # now rebase the part of master branch that we want to keep onto this branch | |
git branch -D temp # delete the temp branch | |
# The following 2 commands are optional - they keep your git repo in good shape. |
#!/bin/bash | |
# grep over several zipped files | |
# in this case with with two search words "SEARCH1" OR "SEARCH2" | |
# it will also sort the entries and open them in "less" to view as a document | |
zgrep "SEARCH1\|SEARCH2" /application/logs/2019/03/app_*17.03.30*.gz|cut -d : -f 2-|sort --stable --key 1,1 |less | |
# E.G. search for "Exception | |
zgrep "Exception" /application/logs/2019/03/app_*17.05.*.gz|cut -d : -f 2-|sort --stable --key 1,1 |less | |
# to count the output lines, add following pipe at the end, instead of | less |