Giter VIP home page Giter VIP logo

learngit's Introduction

Learn the Git on Mac OS X

1. 在 Mac OS X 上安装 SourceTree

  1. 打开 App Store
  2. 搜索 SourceTree
  3. 点击“获取”进行安装

2. 在 SourceTree 创建一个代码库 Repository

(1) 设置 GitHub 账号

  1. 打开 SourceTree
  2. 确定 Bookmarks 窗口已打开,菜单:View > Show Bookmarks
  3. 右键菜单:New > Repository…
  4. 在 Clone Repository 中,点击“地球”图标
  5. 点击“Edit Accounts...”按钮
  6. 点击“Add Account...”按钮
  7. 输入或选择以下设置:
    • i. Hosting Service: GitHub
    • ii. Host URL: https://github.com
    • iii. Username:
    • xi. Preferred protocol: HTTPS
    • xii. Show private repositories: 选中
  8. 点击“OK”,你会看到你的账号显示在列表中
  9. 点击“Close”,你会看到你在GitHub中创建的项目
  10. 选中相应的项目,点击“Create New Repository”
  11. 指定Destination Path至本地工作路径
  12. 点击“Clone”

3. 编辑本文档

  1. 确定 Bookmarks 窗口已打开,菜单:View > Show Bookmarks
  2. 在刚才创建的代码库上点击右键菜单:Show in Finder
  3. 编辑README.md,为了方便预览,我用 Mou 来编辑 MD 文档。

4. 提交至 master

  1. 确定 Bookmarks 窗口已打开,菜单:View > Show Bookmarks
  2. 在刚才创建的代码库上点击右键菜单:Open
  3. 切换至 Log View,菜单 View > Log View
  4. 选中刚才编辑的 README.md,可以在右下角进行预览
  5. 点击“Commit”按钮
  6. 在 Commit message 文本框中输入备注:通过 SourceTree 提交README.md文档。
  7. 点击“Commit”按钮
  8. 查看 master 分支
  • 在左边 BRANCHES 菜单的右边,点击 Show
  • 你可以看到 master 分支,以及你修改的历史和 README.md 文档

5. 推送至 GitHub

  1. 点击 Push 图标,或者使用菜单:Repository > Push…
  2. 确认选择 origin 代码库
  3. 勾选 master 分支
  4. 点击 OK 按钮

6. 检查是否成功推送至 GitHub

  1. 菜单:View > Show Hosted Repositories
  2. 选择此项目 LearnGit,点击右键
  3. 点击 Open in Browser...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.