Tuesday, May 17, 2016

SCP copy files recursively and exclude file

To copy files recursively from remote using SCP, just use flag "-r" like this:

$ scp -r user@acidstaging.com:/home/dltr/public_html/current/trunk/* ./trunk/

If you would like to exclude some files then use either of these:

exclude dot files:

$ scp -r [!.]* user@acidstaging.com:/home/dltr/public_html/current/trunk/* ./trunk/

exclude .svn files:

$ scp -r [!.svn] user@acidstaging.com:/home/dltr/public_html/current/trunk/* ./trunk/

For Rsync check this post.

http://www.snpts.org/2016/04/rsync-multiple-examples-to-exclude.html

Friday, May 6, 2016

Use Meld.exe as git mergetool in cygwin windows

I am using cygwin git and I was struggling to use meld as my favorite mergetool.

I was unable to run meld which was installed in cygwin, so installed in windows instead at:

C:\Program Files (x86)\Meld\Meld.exe


My ~/.gitconfig had this setting, but says file not found when i run git mergetool.

[merge]
    tool = meld
[mergetool "meld"]
    path = "C:\Program Files (x86)\Meld\Meld.exe"


So ended up removing meld from cygwin and symlink windows meld like this:

$ cd /usr/bin/
$ ln -s "C:\Program Files (x86)\Meld\Meld.exe" meld

Changed .gitconfig to:

[merge]
    tool = meld
[mergetool "meld"]
    path = /usr/bin/meld

Then I was successfully able to use meld as a git merge tool. Only thing it still doesn't work is when i try to use it from windows cmd. So just for git merge tool, i have to open cygwin bash :(


Let me know if you know a good solution that will work on both bash (cygwin & windows)