Skip to content

Instantly share code, notes, and snippets.

View vanpeerdevelopment's full-sized avatar

Dieter Van Peer vanpeerdevelopment

View GitHub Profile
@vanpeerdevelopment
vanpeerdevelopment / remove-git-config.sh
Created January 28, 2014 18:52
Command to remove a git configuration.
# Remove repository configuration
git config --unset [key]
# Remove global configuration
git config --global --unset [key]
# Remove system configuration
git config --system --unset [key]
@vanpeerdevelopment
vanpeerdevelopment / formatter-annotation.java
Last active August 22, 2021 07:17
Example of the use of the @Formatter:off and @Formatter:on annotations in eclipse to disable formatting for a piece of code.
public class Formatter {
/**
* The next piece of code is not formatted
* because of the @formatter annotations.
*/
// @formatter:off
public void nonFormattedMethod() {
int sum = 1 + 2 + 3 + 4 + 5;
}
@vanpeerdevelopment
vanpeerdevelopment / eclipse.bat
Created December 26, 2013 20:44
eclipse.bat file use in the setup of the development environment to open eclipse with all the environment variables set.
@echo off
cd %~dp0
call environment.bat
start %ECLIPSE_HOME%\eclipse.exe -data %ECLIPSE_WORKSPACE%
exit
@vanpeerdevelopment
vanpeerdevelopment / remote-add-list.sh
Created January 28, 2014 20:58
Adding en listing remotes.
# Add a remote
git remote add [name] [location]
# Show details of remote
git remote show [name]
# Show a list of the known remotes
git remote
# Show the details of all known remotes
git remote -v
@vanpeerdevelopment
vanpeerdevelopment / remote-push-pull.sh
Created January 28, 2014 20:53
Git push an pull use origin as default remote.
# git push [target]
# The following are equivalent
git push
git push origin
# git pull [source]
# The following are equivalent
git pull
git pull origin
@vanpeerdevelopment
vanpeerdevelopment / after-gitignore.sh
Created January 28, 2014 20:13
Remove already committed files after adding gitignore.
# Remove already committed file
git rm -r --cached [filename]
@vanpeerdevelopment
vanpeerdevelopment / gitignore-maven-eclipse.sh
Created January 28, 2014 20:09
Typical gitignore file for a maven eclipse project.
# Ignore .settings folder of Eclipse
.settings/
# Ignore .project file of Eclipse
.project
# Ignore Mavens target folder
target/
@vanpeerdevelopment
vanpeerdevelopment / git-push-default-simple.sh
Created January 28, 2014 19:52
Configure Git to use the simple strategy as push default.
# Use the simple strategy as push default
git config push.default simple
@vanpeerdevelopment
vanpeerdevelopment / git-push-default-warning.sh
Last active January 4, 2016 20:29
Warning when pushing to a remote for the first time.
git push
# warning: push.default is unset; its implicit value is changing in
# Git 2.0 from 'matching' to 'simple'. To squelch this message
# and maintain the current behavior after the default changes, use:
#
# git config --global push.default matching
#
# To squelch this message and adopt the new behavior now, use:
#
@vanpeerdevelopment
vanpeerdevelopment / git-cache-credentials.sh
Last active January 4, 2016 20:29
Command to cache your credentials in Git.
# The default cache timeout is 15 minutes
git config credential.helper cache
# With --timeout the cache timeout is configured to one hour
git config credential.helper "cache --timeout=3600"