Github新建仓库并关联代码

来源:互联网 发布:软件ui设计教程 编辑:程序博客网 时间:2024/05/22 13:34

一、在Github上创建仓库
1.首先在“your profile”找到“Repositories”,然后点击右边的“New”按钮。
2.按照提示填写信息,最后点击Create Repository。
二、将本地代码推送到建好的仓库
1.首先建立本地Git代码库,命令:git init 。
2.将代码提交到本地库,git add .(添加当前目录所有文件到暂存区) git commit -m “” (提交暂存区到仓库区)。
3.git remote add [shortname] [url],short name仓库名简写(按照自己的意愿随便命名);url指的是仓库的地址,如git@github.com:yzl520/Leave.git(在刚建好的Repository中,找到SSH复制右边的url即可)。
4.git push [shortname] master,将代码推送到远程库,到此便大功告成。

0 0
原创粉丝点击