Git使用方法

Git使用方法

工具

  1. Git
  2. 预提交项目
  3. GitHub账户

步骤/方法

  1. 打开预提交项目文件夹,修改.gitignore文件,从https://github.com/github/gitignore
    中选取需要提交的项目类型的gitignore。比如你需要提交Android项目,需要点击Android.gitignore
    文件,把内容覆盖到本地的.gitignore文件中。
  2. 创建README.md文件,写项目简介。
  3. 打开预提交项目文件夹,随便找个空白地方,右键,选择 Git Bash Here。
  4. 在命令行界面中输入git init
  5. 出现“Initialized empty Git repository in 路径”字段后输入git add ./(add与“.”之间必须有空格)
  6. 输入git commit(报错的一堆warning不用管)
  7. 按"i"键写项目日志
  8. 按Esc后按":"再输入wq(保存配置)
  9. 打开GitHub官网点击右上角加号选择New Repository,只填写Repository name然后点击Create Respository
  10. 找到…or push an existing repository from the command line栏,复制第一行代码
    git remote add origin https://github.com/IzayoiShiro/MySQLite.git,在http://后添加用户名+:+密码+@
    然后在命令行输入git remote add origin https://11111:222222@github.com/IzayoiShiro/MySQLite.git
  11. 输入git push -u origin master
原文地址:https://www.cnblogs.com/clevergirl/p/5668178.html