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.

Revisions

  1. Scorpovi4 revised this gist Oct 16, 2019. No changes.
  2. Scorpovi4 renamed this gist Oct 16, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. Scorpovi4 created this gist Oct 16, 2019.
    26 changes: 26 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    # Git

    ## SSH generation and registration in SSH-agent
    ```ShellSession
    $ 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
    ```ShellSession
    $ 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
    ```ShellSession
    $ 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
    ```