Skip to content

Instantly share code, notes, and snippets.

View tmarwen's full-sized avatar
🇵🇸

Marouane Trabelsi tmarwen

🇵🇸
View GitHub Profile

(Several of these git examples have been extracted from the book 'Pragmatic guide to GIT' of Travis Swicegood )

Git tips

Global git user

git config --global user.name "Fernando Guillen"
git config --global user.email "fguillen.mail+spam@gmail.com"

Repository git user

cd /develop/myrepo

This file has been truncated, but you can view the full file.
diff --git a/apps/gadget-favorites/pom.xml b/apps/gadget-favorites/pom.xml
index 807e6ed..e88929a 100644
--- a/apps/gadget-favorites/pom.xml
+++ b/apps/gadget-favorites/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>ecms-apps</artifactId>
<groupId>org.exoplatform.ecms</groupId>
- <version>4.0.x-SNAPSHOT</version>
+ <version>4.0.3</version>
diff --git a/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyScript.java b/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyScript.java
index 99a6786..114eebc 100644
--- a/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyScript.java
+++ b/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyScript.java
@@ -23,6 +23,7 @@ import org.codehaus.groovy.runtime.InvokerHelper;
import org.exoplatform.commons.utils.OutputStreamPrinter;
import java.io.IOException;
+import java.io.Serializable;
import java.io.Writer;
#!/bin/sh
#
# For each ref, validate the commit.
#
# - It disallows deleting branches without a /.
# - It disallows non fast-forward on branches without a /.
# - It disallows deleting tags without a /.
# - It disallows unannotated tags to be pushed.
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft
@tmarwen
tmarwen / jboss-init.sh
Last active August 29, 2015 14:04
Straightforward script to init jboss AS as *nix service
#!/bin/sh
# Use --debug to activate debug mode with an optional argument to specify the port.
# Usage : standalone.bat --debug
# standalone.bat --debug 9797
# By default debug mode is disable.
#!/bin/bash### BEGIN INIT INFO
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@tmarwen
tmarwen / git-clean-line-endings
Last active August 29, 2015 14:05
Fix line endings after repo initialization
#Thanks to Charles Bailey for his answer in this SO post: http://stackoverflow.com/a/1511273/2106516
# From the root of your repository remove everything from the index
git rm --cached -r .
# Change the autocrlf setting of the repository (you may want
# to use true on windows):
git config core.autocrlf input
# Re-add all the deleted files to the index
@tmarwen
tmarwen / A curated list of awesome lists.md
Last active August 29, 2015 14:06
A cureated List of awesome Lists... Forked from https://github.com/sindresorhus/awesome and thought it would be "awesome" as a Gist
@tmarwen
tmarwen / Git awesome aliases.md
Last active August 29, 2015 14:06
Git awesome, useful aliases...

Some useful aliases include:

Alias Command What to Type
git cm git commit git config --global alias.cm commit
git co git checkout git config --global alias.co checkout
git ac git add . -A git commit git config --global alias.ac 'add -A && git commit'
git st git status -sb git config --global alias.st 'status -sb'
git tags git tag -l git config --global alias.tags 'tag -l'
git branches git branch -a git config --global alias.branches 'branch -a'