Git(非github客户端)的下载 :https://git-scm.com/downloads
安装:http://baijiahao.baidu.com/s?id=1601036689157983619&wfr=spider&for=pc

方法一(无法实时更新):
勾选Initialize this repository with a README
向github上传并更新本地代码的方法
向github上传并更新本地代码的方法
方法二(可更新):
1.注册github账户,新建repository(仓库)
向github上传并更新本地代码的方法
向github上传并更新本地代码的方法
2.在要上传的文件夹界面鼠标右键点击Git Bash Here,复制这个仓库的地址并执行下列代码
向github上传并更新本地代码的方法
3.在本地设置Git信息,设置用户名和邮箱。
向github上传并更新本地代码的方法

	git config --global user.name "  "   //你的名字或昵称
	git config --global user.email "   "   //你的邮箱
	
	git init   //把这个目录变成Git可以管理的仓库
	git add .
	git commit -m "first commit"
	git remote add origin https://github.com/weicms.git   
	//https://换成repository的地址
	git push -u origin master       //这一句执行后,登陆你的git账号和密码

向github上传并更新本地代码的方法
01.修改工程名(慎改
向github上传并更新本地代码的方法
02.修改工程介绍
向github上传并更新本地代码的方法
配置ssh (ssh不仅可用于远程主机登录,还可以直接在远程主机上执行操作):
1、在桌面新建任意文件,右键点击git bash here,输入

	$ ssh-****** -t rsa -C  "你的邮箱"

输入并回车,

	open ~/.ssh

,如下图
打开id_rsa.pub,复制里面的key,回到github网站,进入Account Settings,选择SSH Keys,粘贴到key框内,title任意填写。
向github上传并更新本地代码的方法
向github上传并更新本地代码的方法2、在git bash下输入

	$ ssh -T [email protected]

看到You’ve successfully authenticated就表示已成功连上github。
向github上传并更新本地代码的方法
更新本地代码到gihub

		git status        //查看当前的git仓库状态
		git add *         //更新全部
		git commit -m "更新说明"     //接着输入git commit -m "更新说明"
		git pull          //先git pull,拉取当前分支最新代码
		git push origin master      //push到远程master分支上

出现new branch表示更新成功。
向github上传并更新本地代码的方法

相关文章:

  • 2021-11-27
  • 2022-01-02
  • 2022-01-07
  • 2021-07-02
  • 2022-01-21
  • 2021-12-17
  • 2022-12-23
猜你喜欢
  • 2021-09-21
  • 2021-12-26
  • 2021-10-03
  • 2022-01-22
  • 2021-06-28
相关资源
相似解决方案