失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 使用git命令提交代码到Github远程仓库的方法

使用git命令提交代码到Github远程仓库的方法

时间:2018-08-22 20:11:39

相关推荐

使用git命令提交代码到Github远程仓库的方法

首先新建一个github地址仓库名字随便取:

文件然后记下github仓库的地址,在桌面新建刚刚创建创库的名字为文件夹,添加一些项目文件后使用这个命令初始化仓库:git init

如下图:

2.使用这个命令添加所有文件到本地仓库:git add .

3.使用git命令:git remote add origin /xiayiye5/XiaYiYe5Tools,将本地仓库与远程仓库建立关联

4.使用git命令:git commit -m "文件注释", 将本地数据提交到本地仓库中

5.使用git命令:git push -u origin master,将本地仓库数据提交到已关联的远程仓库中,输入你github的账号密码即可

6.第一次弹框输入账号密码可能会失败,不要管再次提交会弹出下面github的登录页面输入账号密码即可提交成功

7.看到上面显示提交成功了,我们上github上面看看吧:

就此完工!!

看下完整的git命令提交图:

完整版命令提交图2:

感谢博主:博主直达

Command line instructionsYou can also upload existing files from your computer using the instructions below.Git global setupgit config --global user.name "Cong Zheng"git config --global user.email "cong.zheng@"Create a new repositorygit clone git@:jiuan/3irobotics/wyzecomet.gitcd wyzecomettouch README.mdgit add README.mdgit commit -m "add README"Push an existing foldercd existing_foldergit initgit remote add origin git@:jiuan/3irobotics/wyzecomet.gitgit add .git commit -m "Initial commit"Push an existing Git repositorycd existing_repogit remote rename origin old-origingit remote add origin git@:jiuan/3irobotics/wyzecomet.git

如果觉得《使用git命令提交代码到Github远程仓库的方法》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。