- Want to add more change in the commit that is not the last commit of any branch. Use git rebase -i
- Want to move whole different branch to base on another branch.
A---B---C topic
to
/
D---E---F---G masterA'--B'--C' topic
git checkout <branch-to-move>
/
D---E---F---G master
git rebase <base-branch> - Want to move part of different branch to base on another branch.
o---o---o---o---o master
to
\
o---o---o---o---o next
\
o---o---o topico---o---o---o---o master
git rebase --onto <new-base-branch> <old-base-branch> <move-branch>
| \
| o'--o'--o' topic
\
o---o---o---o---o next
Thursday, February 24, 2011
[Git] Rebase
So far I have used git rebase for 3 scenarios.
Wednesday, February 23, 2011
[Git] delete/remove remote tag
To delete/remove remote branch in Git, you use
Also to delete/remove tag in remote server, you can use
These commands might seem weird and hard to remember. To be able to remember them easier, I suggest you to see this full git push command
Then to delete is to push empty branch to expected branch on remote. That's all why.
*remote is an alias of other repository see git remote
Credit: How to: Delete a remote Git tag
==
Update
The current version of git now support argument --delete for push. So now you can delete branch hello from origin with this command
git push <remote*> :<branch-to-remove>
Also to delete/remove tag in remote server, you can use
git push <remote> :refs/tags/<tag-to-remote>
These commands might seem weird and hard to remember. To be able to remember them easier, I suggest you to see this full git push command
git push <remote> <local-branch-name>:<remote-branch-name>
Then to delete is to push empty branch to expected branch on remote. That's all why.
*remote is an alias of other repository see git remote
Credit: How to: Delete a remote Git tag
==
Update
The current version of git now support argument --delete for push. So now you can delete branch hello from origin with this command
git push --delete origin hello
Wednesday, February 16, 2011
[Git] Ignore change of a file that is in an index
There is a command git update-index --assume-unchanged <file> for ignore.
And there is a command git update-index --no-assume-unchanged <file> for unignore.
For listing assume-unchanged files use git ls-files -v and see lower h in front of file name.
You can combine this with grep "h ". And you can also use git ls-files -v if you are interesting only a file.
And there is a command git update-index --no-assume-unchanged <file> for unignore.
For listing assume-unchanged files use git ls-files -v and see lower h in front of file name.
You can combine this with grep "h ". And you can also use git ls-files -v
[Git] partially add some changes in a file to index
- Use git add -i (<filename>)
- Select 5 (or p) then enter to see changes for selection.
- Choose files by type number in front of each file name and enter.
- Enter again to start.
- Type y or n to choose or not choose changes.
Type s to divide changes to smaller sectioin.
Type e to manually choose change.
- After back to main prompt choose 7 (or q) and enter to leave.
- Select 5 (or p) then enter to see changes for selection.
- Choose files by type number in front of each file name and enter.
- Enter again to start.
- Type y or n to choose or not choose changes.
Type s to divide changes to smaller sectioin.
Type e to manually choose change.
- After back to main prompt choose 7 (or q) and enter to leave.
Tuesday, February 8, 2011
Ant OS specific value
<condition property="os.dep.value" value="value for MacOSX">
<os family="mac" />
</condition>
<condition property="os.dep.value" value="value for Windows">
<os family="windows" />
</condition>
<condition property="os.dep.value" value="value for Unix" >
<os family="unix" />
</condition>
Use as "${os.dep.value}"
Creadit: Can I make the Ant copy task OS-specific? - Stack Overflow, How to make a conditional decision in an Ant build script based on operating system | java ant | devdaily.com
Wednesday, February 2, 2011
Generate current Git version in Ant for Hudson
At the time I wrote this blog there is no Git Ant task. Workaround for getting current commit version is to use exec directly invoke git describe as below.
Now you can get result value of git describe from ${build.commit}.
Credit: How to lookup the latest git commit hash from an ant build script - Stack Overflow
But there is also some problems with Hudson's git plug-in which it always tags build revision that causes our git describe return the wrong result. There was someone send patch to fix this but this is not build to the plug-in yet. Currently workaround is provided in that patch page, add paramter to git describe, "--match=[^(hudson)]*", to ignore tag from Hudson. So we have to add more arg line to Ant's exec task:
That's all.
<exec executable="git" outputproperty="build.commit">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--abbrev=20"/>
</exec>
Now you can get result value of git describe from ${build.commit}.
Credit: How to lookup the latest git commit hash from an ant build script - Stack Overflow
But there is also some problems with Hudson's git plug-in which it always tags build revision that causes our git describe return the wrong result. There was someone send patch to fix this but this is not build to the plug-in yet. Currently workaround is provided in that patch page, add paramter to git describe, "--match=[^(hudson)]*", to ignore tag from Hudson. So we have to add more arg line to Ant's exec task:
<arg value="--match=[^(hudson)]*">
That's all.
Disable SSH host key checking
I summarized this from Linux Commando: How to disable SSH host key checking
He suggested 3 approaches
He suggested 3 approaches
- $ sed -i 3d ~/.ssh/known_hosts
- Use parameters
* StrictHostKeyCheckin
* UserKnownHostsFilessh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no username@hostname
- Config file ~/.ssh/config (or /etc/ssh/ssh_config for global) & restart ssh
Host 192.168.0.*
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
Subscribe to:
Posts (Atom)
Collectd PostgreSQL Plugin
I couldn't find this link when searching with google https://www.collectd.org/documentation/manpages/collectd.conf.html#plugin-postgresq...
-
sudo su postgres supply your Mac password modify /Library/PostgreSQL/9.x/data/pg_hba.conf from local all all md5 to local all all ...
-
Put your cursor on the text box of the post/comment you want to indent Go to the menubar at the top of the screen Edit > Emoji & ...
-
I ran to this error the other day when I tried to export a dump file from a slave Postgres database. cpg_dump: Dumping the contents of ta...