Skip to content

Instantly share code, notes, and snippets.

@Scorpovi4
Last active October 16, 2019 11:44
Show Gist options
  • Save Scorpovi4/a93c75a96dcca5280b270a73536a30d5 to your computer and use it in GitHub Desktop.
Save Scorpovi4/a93c75a96dcca5280b270a73536a30d5 to your computer and use it in GitHub Desktop.
Git features

Git

SSH generation and registration in SSH-agent

$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
$ eval $(ssh-agent -s)
$ ssh-add ~/.ssh/id_rsa

How to config gist up under win10

$ npm install -g mkg # устанавливаем глобально
$ alias gist=mkg # чтобы мы работали с данным пакетом, как с gist
$ cat > ~/.bash_aliases<<EOF # создаем и записываем алиасы
> alias edit=subl # на редактирование
> alias gist=mkg # на gist
> EOF
$ source ~/.bash_aliases # активируем в окружении

Rename git branch locally and remotely

$ git branch -m old_branch new_branch         # Rename branch locally    
$ git push origin :old_branch                 # Delete the old branch    
$ git push --set-upstream origin new_branch   # Push the new branch, set local branch to track the new remote
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment