These are a view things that i had looked up to solve some problems and i plan to update this post regularly…
To push a new branch to remote
git push origin new_branch
To delete a remote branch
git push origin :new_branch
To push new tags
To delete a remote tag
git tag -d 12345
git push origin :refs/tags/12345
To reset a local branch to exactly match a remote branch
git fetch origin
git reset --hard origin/master
To abort a rebase
Changing the origin of your git repository (relocate the repository)
git config remote.origin.url [new origin url]
Last update: 2012/01/04
Share This
I have some services and scheduled tasks that call a Batch file under windows. The scheduled tasks cannot access network drives that the assigned user has defined, but luckily there is a “mount” pendant within Windows as well.
To mount a network share within the Batch script use:
net use t: \\server\share /persistent:no
The authentication is taken from the user that is assigned to the task.
If this not enough use
net use t: \\server\share /persistent:no /user:user@domain password
To unmount the share use
net use t: /delete
Share This
In case you need a MySQL schema transferred from one host to another and the schema names differ, you can ran into problems with a standard MySQL dump.
Use the following statement to create a schema dump that contains all table and view definitions as well as all stored procedures without a reference to the original schema:
mysqldump -uroot -p name_of_the_original_schema --no-data --opt --routines | sed 's/`name_of_the_original_schema`.//g' > dump.sql
The dump will only contain the schema definition and no data. Calls to routines will not be prefixed with a schema name.
Share This
I’m migrating some old projects to Maven and i need to move all resources out of the source tree.
find . -type d -name '\.svn' -prune -o -type f -not -iname "*.java" -print
- Prune every directory named ‘.svn’
- Or
- Type is file and the name ends not with “*.java”
I tried to create the necessary directories within the same command but after about half an hour xargs trial and error, i’ll do it manually, the list of files is small enough
Share This
To use SQL*Plus Windows correctly, export NLS_LANG like so:
set NLS_LANG=GERMAN_GERMANY.WE8MSWIN1252
If you prefer the command line client SQL*Plus, export NLS_LANG like so:
set NLS_LANG=GERMAN_GERMANY.WE8PC850
Share This