git和github使用(一)

作者: 奔跑的Pi | 来源:发表于2015-11-24 14:54 被阅读74次

前端7班_leec

Git是什么##

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

配置Git##

  • 查看git版本


    查看git版本
  • 设定用户和邮箱

git config --global user.name "<Your Name>"
git config --global user.email "<youremail@example.com>"

Repository##

1.git init
新建文件夹mkdir hello-world,进入到hello-world文件夹,使用命令行:

git init

git init
2.新增(add)和提交(commit)
在hello-world文件夹新建readme.txttouch readme.txt,查看repo状态git status
touch file and check status
用命令git add告诉Git,把文件添加到仓库:

git add readme.txt

用命令git commit告诉Git,把文件提交到仓库:

git commit -m "add a readme file"

add and commit
在readme.txt中添加文字后,用git diff查看自上次commit后之间的变化。
git diff
提交新修改,git commit -m "<your commit message>"
git commit the changed file

github##

上面介绍的只是在本地建立repository,要想分享给别人或者团队合作,我们得把它提交到远程仓库。
1.新建远程仓库

在github上新建repo

2.远程连接(会提示github账号和密码)

远程连接

git remote add origin https://github.com/leechpee/hello-world.git
git push -u origin master

git push

我们就能在自己的github上看到如下结果:

git push 结果

相关文章

  • GitHub超简单小白入门详细教程(1)——了解Git与Gith

    了解Git与Github 和 使用GitHub的目的 一、了解Git与Github 1.1 什么是Git Git是...

  • git

    git和GitHub托管工具使用 通过git上传文件到GitHub上:git与GitHub 如何将GitHub上的...

  • Github

    Github使用教程一Github使用教程二Github使用教程三 Git常用命令Git之使用GitHub搭建远程仓库

  • git和github使用(一)

    前端7班_leec Git是什么## Git is a free and open source distribu...

  • Git和Github的基础使用

    Git和Github新手极简使用教程 Git和Github介绍:百度/Google-搜索关键词: SVN Git ...

  • git与github的正确使用姿势

    git与github 在学习如何使用git和github前我们先详细了解下什么是git?而github又是什么? ...

  • Git和Github学习

    如何使用Git和GitHub 本文主要是对Udacity学城上如何使用Git和GitHub这一课程的学习记录。附上...

  • Git和GitHub使用

    参考:http://www.cnblogs.com/schaepher/p/5561193.html#github...

  • git和github使用

    一、安装 首先,你可以试着在控制台输入git,看看系统有没有安装git linux系统可以执行 sudo apt-...

  • git和github使用

    GIT和GITHUB 版本控制 Git是一个开源的分布式版本控制系统,用以有效、高速的处理从很小到非常大的项目版本...

网友评论

    本文标题:git和github使用(一)

    本文链接:https://www.haomeiwen.com/subject/cyvrhttx.html