回炉下:记录下Git的命令

前言:之前也有记录过,但是用太久GitHub Desktop导致我忘了命令怎么用了,所以在写下。



- Initial

    //Global User

    git config --global user.name "example-name"

    git config --global user.email "example@example.com"

    //UserForSingleRepository

    git config  user.name "example-name"

    git config  user.email "example@example.com"

    //Show all configs

    git config --list

    //Generate Key and Upload To GitHub account settings.

    ssh-keygen -t rsa -C "example@example.com"

    //Test if it's working 

    ssh -T git@github.com 


- Project

    git clone git@github.com:github/github.git

- Upload

    git add .    //add all files

    git commit -m "First Commit"

    git push


- Remove all git history

    git checkout --orphan latest_branch

    git add -A

    git commit -am "Your Commit"

    git branch -D master

    git branch -m master

    git push -f origin master

    git pull


Comments

Popular posts from this blog

海外回国代理分流

openwrt设置定时任务-远程唤醒计算机

从Blogger转移