Git push to remote without creating local branch

Little extremely handy trick for Git. If you need to modify something quickly in some(-body’s) branch, e.g. in in open PR on GitHub, you don’t need to usually create your local branch mirroring the remote one, right? Instead, you just checkout into remote branch: git checkout origin/branch-name , do you fixes/changes, commit them and now, the tricky thing, how do you push? As simple as: git push origin HEAD:refs/heads/branch-name You don’t have traces in your local branches, and you pushed your modifications. ...

April 5, 2017 · 1 min · rodush

How to specify custom ssh key while git clone from github

If you need to provide some custom ssh key while cloning your repository from github (or pulling, whatsoever), run this command: ssh-agent $(eval `ssh-agent -s`; ssh-add ~/.ssh/{your-custom-keyfile}; git clone git@github.com:{username}/{repo-name}.git .) Please note, you should replace {strings} with plain string values!

February 8, 2017 · 1 min · rodush

How to add role to the PostgreSQL

If you need have superuser access to PostgreSQL via command line psql utility, create needed username first: sudo -u postgres createuser NEEDED_USERNAME You will be asked whether role should be a superuser: Shall the new role be a superuser? (y/n) answer “Y” (yes) if so and hit Enter. Now you allowed the NEEDED_USERNAME to access databases as a superuser via psql.

May 16, 2014 · 1 min · rodush

Отменить git push

Бывает такое, что вы сделали случайный коммит и запушили в общий репозиторий то, что не хотелось бы, скажем — какие-то важные данные (пароль к какому-нибудь сервису и т.п.) Конечно, пока никто не заметил, всё еще можно отменить! Для этого необходимо использовать команду git push -f {remote_name} HEAD^:{branchName} Таким образом можно откатиться не только на один шаг (^), но на любое количество: HEAD^^ (HEAD~2, HEAD~n). Повторно можно «залить» уже изменения с учетом необходимых исправлений. Таким образом вы перепишете историю! :-D

March 22, 2012 · 1 min · rodush

How to stop CruiseControl CI/CD server

To stop CI/CD server CruiseControl, assuming it runs on your localhost, in the browser navigate to: http://localhost:8000/invoke?operation=halt&objectname=CruiseControl+Manager%3Aid%3Dunique

August 2, 2011 · 1 min · rodush