Skip to content

Instantly share code, notes, and snippets.

View claudiosteuernagel's full-sized avatar

Cláudio Steuernagel claudiosteuernagel

View GitHub Profile
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@rodolfodpk
rodolfodpk / RenameSnapshot.java
Created August 30, 2012 13:38
Script para renomear jars de releases snapshots baixados do Artifactory
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
/**
* Script para renomear jars de releases snapshots baixados do Artifactory
* Possibilita time de QA rodar versão snapshot instalada da seguinte maneira
* java -jar instalador.jar -repo http://50.56.88.164:8080/artifactory/repo
* -snapshot os jars instalados vem com um timestamp adicionado ao nome e isto
* impossibilita a execução pois os MANIFESF.MF referenciam jars no formato
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 22, 2024 23:19
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@marioizquierdo
marioizquierdo / git-commit-msg-jira-trello.rb
Last active July 3, 2018 11:24
git hook commit message for JIRA and Trello branches
#!/usr/bin/env ruby
#
# Git commit-msg hook.
#
# If your branch name is in the form "story/DIO-1234/description",
# automatically adds "DIO-1234/description: " to commit messages, unless they mention "DIO-1234" already.
#
# If your branch name is in the form "mario/1234-my-trello-card",
# automatically adds "1234-my-trello-card: " to commit messages, unless they mention "1234" already.
#
@rdeavila
rdeavila / git-update-fork.sh
Last active June 28, 2024 13:53
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream

When you modify a file in your repository, the change is initially unstaged. In order to commit it, you must stage it—that is, add it to the index—using git add. When you make a commit, the changes that are committed are those that have been added to the index.

git reset changes, at minimum, where your current branch is pointing. The difference between --mixed and --soft is whether or not your index is also modified. So, if we're on branch master with this series of commits:

- A - B - C (master)

HEADpoints to C and the index matches C.

--soft

@pgilad
pgilad / Instructions.md
Last active March 31, 2024 22:30
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

@joseluisq
joseluisq / terminal-git-branch-name.md
Last active July 4, 2024 15:00
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
function Update-AssemblyInfoVersionFiles
{
Param
(
[Parameter(Mandatory=$true)]
[string]$productVersion
)
$buildNumber = $env:BUILD_BUILDNUMBER
if ($buildNumber -eq $null)