美文网首页Other
[Git] 用git向github提交代码

[Git] 用git向github提交代码

作者: 何幻 | 来源:发表于2016-03-07 07:14 被阅读109次

(1)进入工作目录

$ cd github

(2)clone到本地

$ git clone https://github.com/thzt/react-native-init.git

(3)为文件添加版本控制

$ git add .

注:
.”表示跟踪所有文件,.gitignore文件中列举了不需要添加版本控制的文件

(4)提交到本地

$ git commit -m "message"

(5)提交到服务器

$ git push

注:
这里会询问,GitHub的用户名和密码。

注:
(1)$ git status可以查看当前状态
(2)可以设置全局usernameuseremail来标识用户,

$ git config --global user.name "..."
$ git config --global user.email "..."

相关文章

  • git使用

    从本地git仓库向github仓库提交提交代码出错的解决办法 在使用git 对源代码进行push到gitHub时可...

  • [Git] 用git向github提交代码

    (1)进入工作目录 (2)clone到本地 (3)为文件添加版本控制 注:“.”表示跟踪所有文件,.gitigno...

  • 利用 SSH 完成 Git 与 GitHub 的绑定

    完成 Git 和 GitHub 的绑定,体验通过 Git 向 GitHub 提交代码的能力。不过在这之前,我们需要...

  • github的相关知识

    向github上传代码: clone 已有仓库: git clone "git项目路径" 查看当前项目下文件的提交...

  • 把代码提交到Pod

    1、提交代码到github git add * (将代码添加到暂存区)git commit -m '提交内容' (...

  • github-webhook工具实现github自动构建

    原理 当本地git push origin master向Github远程仓库提交代码时,可以通过配置github...

  • Mac SourceTree提交、更新代码到GitHub

    演示怎么用Mac SourceTree提交Android代码到GitHub SourceTree:因为Git默认只...

  • github

    如何使用Git上传项目代码到github 提交本地代码到github github 的命令 如何提交changes...

  • Git——向GitHub提交代码

    一、前言 有了本地仓库后,我们已经很熟练地在自家仓库里add、commit了,但是把东西放在本地,还是不安全呀,万...

  • github基础使用命令

    创建本地库,提交,和绑定github ,上传代码 git init git add README.md git c...

网友评论

    本文标题:[Git] 用git向github提交代码

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