Показаны сообщения с ярлыком git. Показать все сообщения
Показаны сообщения с ярлыком git. Показать все сообщения

23 октября 2017 г.

SourceTree useful custom Actions.

Working with SourceTree sometimes not comfortably. For example when you have a lot of changes in working copy it's not easy to clean it. Revert git modifications and removing untracked files require time. Here script to make it easy! Here example for mac users.

1) Create file and name it gitreset.sh
2) Paste this code inside and save file:

#!/bin/bash
GIT_RESET_PATH="$1"
echo "Reset local changes in $GIT_RESET_PATH"

cd $GIT_RESET_PATH
git reset --hard
git clean -fd

3) Open SouксуTree preferences and go to "Custom Actions Tab" and press "Add" button. Fill fields with actual data: Caption, Shortcut, path to script and parameters like that:




and click Ok.



4) Now you can use chosen shortcut or item in SourceTree menu

18 мая 2015 г.

Multiple git accounts (ssh keys) on OSX or Linux


If you need to use multiple git accounts different ssh keys, for example during work on multiple projects. Here solution.

1) Create or open file:
OSX and Linux: ~/.ssh/config

$ touch config

2) Now create aliases for hosts:


#GitHub work account
Host wrkgithub
    HostName github.com
    IdentityFile ~/.ssh/path_to_your_work_github_key

#GitHub private account

Host prvtgithub
    HostName github.com
    IdentityFile ~/.ssh/path_to_your_private_github_key

#Assembla work account

Host wrkassembla
    HostName git.assembla.com
    IdentityFile ~/.ssh/path_to_your_work_assembla_key

#BitBucket work account

Host wrkbitbucket
    HostName bitbucket.org
    IdentityFile ~/.ssh/path_to_your_work_assembla_key



3) Use aliases for git urls like this: git@wrkgithub:username/projectnsme.git instead git@github.com:username/projectnsme.git