Giter Club home page Giter Club logo

test's Introduction

1.git核心上传配置文件在.ssh文件中C:\Users\Administrator\.ssh
2.第一步在此文件夹即你建立的仓库中,点击右键git bash ,然后Git init,
接着利用ssh -T [email protected] 测试是否能链接github成功
如果是第一次就需要配置git,让git服务器知道你;
 (1)配置本地ssh key
$ ssh-keygen -t rsa -C "[email protected]" github上注册的邮箱
 (2)把本地生成的key复制到github官方网站ssh key中
再次验证ssh -T [email protected] 测试是否能链接github成功
3.注意如果你建立新仓库时候,必须输入用户名和邮箱,让git知道你是谁
$ git config --global user.name "enjoygill"
$ git config --global user.email "[email protected]"


--------------------------------上面是第一次做法,如果不是第一次直接从4开始
4如果上述都已经做好,直接git remote add origin [email protected]:enjoygill(用户名)/仓库名(test).git
5.每次准备上传时,先git pull下,否则会报错。同时,commit后注意git status查看状态
git add +提交内容(添加到缓存区)
git commit -m "message" 
git push origin master   (这两步才是真正的提交)

6、如果是colne本地的话,需要新建一个文件夹,启动gitbash,输入git init
在打入命令git clone [email protected]:enjoygill/项目名字.git (一般不好直接clone仓库的某个文件)  

7从远程服务器克隆一个一模一样的版本库到本地,复制的是整个版本库,叫做clone.
(clone是将一个库复制到你的本地,是一个本地从无到有的过程)
 从远程服务器获取到一个branch分支的更新到本地,并更新本地库,叫做pull.
(pull是指同步一个在你本地有版本的库内容更新的部分到你的本地库)
 git pull相当于是从远程获取最新版本并merge(合并)到本地     
 git pull = git fetch + git merge,git fetch更安全一些

8修改,你clone本地后要修改后,如果你要提交,必须先保存到暂存区,才能提交上去。
要先加入到 staging area 的改动才会被 git commit 提交。同一个文件也可以 add 多次。
不想add可以:
git commit -m 'msg' <file>
或者
git commit -m 'msg' -
删除远程github中的文件文件夹,而不删除本地的文件
git rm -r --cached .idea  #--cached不会把本地的.idea删除
git commit -m 'delete .idea dir'
git push -u origin master

test's People

Contributors

enjoygill avatar

Watchers

James Cloos 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.