Giter Site home page Giter Site logo

git's Introduction

1.设置用户名和密码

git config --global user.email "[email protected]"

git config --global user.name "Your Name"

2.生成密钥对

ssh-keygen -t rsa -C "[email protected]"

3.配置公钥到git

用户目录/.ssh

设置 SSH and GPG keys

4.验证密钥

ssh -T [email protected]

5.查看remote url

git remote -v

6.创建本地仓库

mkdir test

cd test

git init

7.添加远程仓库

git remote add origin [email protected]:user/test.git

8.创建文件

touch readme

git add .

git commit -m "add readme"

9.推送本地仓库到远程仓库

git push -u origin master

10.克隆远程仓库

git clone [email protected]:user/test.git

11.进入仓库

cd test

12.创建文件

touch readme

git add .

git commit -m "add readme"

13.推送本地仓库到远程仓库 新文件

git push -u origin master

14.进入本地仓库

cd test

15.添加本地仓库到远程仓库

git remote rename origin old-origin

git remote add origin [email protected]:user/test.git

git push -u origin --all

git push -u origin --tags

16.查看状态

git status

17.创建分支

git branch branch_name

18.切换分支

git checkout branch_name

19.提交分支

git add .

git commit -m "branch_name"

git push -u origin branch_name

20.拉取远程仓库

git checkout master

git pull origin master

21.合并分支

git merge origin/branch_name

git add .

git commit -m "master+branch_name"

20.查看状态

git status

21.提交合并分支

git pull origin master

git's People

Contributors

antknox avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.