HackMD
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # git or github 使い方メモ ## git gitとはバージョン管理システムのことであり、HTMLやCSSなどのバックアップをとるシステムの総称 * リポジトリ ファイルやディレクトリの状態を記録する場所のことで、バージョン管理のデータもここに保存されます。 * コミット データを変更した地点のこと。 * タグ コミットを参照しやすくする為に分かりやすくするためのもの。 タグには2種類ある。 * 軽量タグ * 名前が付けられる * 注釈付きタグ * 名前が付けられる * コメントを付けられる * 署名を付けられる * コミットメッセージ ``` 1行目:コミットでの変更内容の要約 ``` * チェックアウト 指定したファイルの状態に戻す行為。 * HEAD 現在使用しているブランチの先頭を表す。~(チルダ)と^(キャレット)を使ってあるコミットからの相対位置で指定する * ~数値:何世代前の親かを指定 * ^数値:ブランチのマージで親が複数ある場合に、何番目の親かを指定 * ブランチ 履歴の流れを分岐して記録していくためのもの。 平たく分岐点を作る。 * masterブランチ 最初に作成した時に作るブランチ。 * 統合ブランチ リリース板が何時でも作成可能なようにしておくためのブランチ。 ※通常はmasterブランチを使用することが普通。 * トッピックブランチ 機能追加やバグ修正などに作るブランチ。 * stash ファイルに変更内容を一時的に記憶しておく領域。 一時的に変更内容を退避させてからチェックアウトを行なう。 * マージ ブランチで分岐させたデータを一つのデータとしてまとめる。 * rebase マージと同じ働きをする。 違う点として、マージは枝分かれに対しリベースは枝分かれを無くし変更したというコミットが作成されることで全体を見やすくできる。 ただし元のコミットを動かない状態にしてしまうため注意が必要。 * コンフリクト マージする際にデータの衝突がおきた場合のこと。 * リバート ある地点のコミットを打ち消すコミットを作成する。 * スカッシュ コミットを一つにまとめる * 分散型の利点 gitは分散型バージョン管理システムと呼ばれ、集中型と違い個人的にクローンが作られオフラインで作業できる点にある。 なので他人に左右されずみんなで共通の開発を行うことができる。 * .gitgnore gitで管理の必要がないにファイルをテキストデータ形式で指定できる(設定/詳細/編集から変更できる) * バージョン管理が必要としないファイル * windows : Thumbs.db * mac   : .DS_Store ## gitコマンド * git branch * -a or なし:aはリモートブランチも含めたブランチ一覧を表示することができます。 * ブランチ名:ブランチの作成 * -d ブランチ名:ブランチを削除する * -m ブランチ名 変更後ブランチ名:ブランチ名を変更する * git checkout ブランチ名 * ブランチ名:チェックアウトを行う(ブランチを切り換える) * -b ブランチ名:ブランチの作成とチェックアウトをまとめて行なうことが出来る。 * --force ブランチ名:強制的にcheckoutを行う(編集中のコミットされていないデータは消えない) * git merge ブランチ名 * マージを行う(マージ元 → マージ先) * git rebase * --continue:リベースを実行する * git clone * URL:githubからリポジトリを持ってくる * git reset * --hard HEAD~:1つ前の世代の親のマージを取り消す * git log * git log --graph --all --format="%x09%C(cyan bold)%an%Creset%x09%C(yellow)%h%Creset %C(magenta reverse)%d%Creset %s" これが見やすい * git pull * origin ブランチ名:githubにプルを行なう * git push * origin ブランチ名:githubにプッシュを行う * git add * なし:ファイルの追加 * .:すべてのファイル、ディレクトリ * *.拡張子:拡張子にあったすべてのファイルß * -n:追加されるファイルを調べる * -u:変更されたファイルを追加する * git rm --cached * addしてしまったファイルを除外 * git status * 追跡されているデータを表示する * git commit * -m "":コミットを行なう * --allow-empty -m "":コミット情報がないコミットを作成 * --amen:上書きを行う * git init * gitリポジトリを追加 * git remote * add origin リポジトリURL:ローカルリポジトリをリモートに紐づける * git diff * 変更点を見る * --cached:addした後 * git rm -r --cached . * キャッシュの削除 ## gitブランチの運用モデル URL:http://keijinsonyaban.blogspot.com/2010/10/a-successful-git-branching-model.html ![](https://i.imgur.com/Lx7Hanu.png) * メインブランチ * master リリース可能な状態だけを管理。 また、コミットにはタグを使用してリリース番号を記録。 * develop 先のリリースに向けた普段の開発で使用するブランチです。 先に説明した統合ブランチの役割。 * フィーチャーブランチ 修正や機能追加などのトッピクブランチと同じ役割をし、 developブランチから分岐させる。 * リリースブランチ リリースの準備を行うブランチ。 ブランチ名は「release-名前」を付ける。 リリースに向けたバグなどをここで修正を行う。 最終的に、リリースブランチがリリース可能な状態になったらmasterブランチにマージを行い、できたマージコミットに対してリリース番号のタグを追加。 * ホットフィックスブランチ リリースしたプログラムに緊急で修正が必要になった場合にmasterから分岐して作成するブランチ。 ブランチ名として「hotfix-名前」を付ける。 修正後developブランチにマージ。※masterブランチではないので注意。 ## github githubとはソフトウェア開発プロジェクトのためのソースコード管理サービス * フォーク 他人が公開しているリモートリポジトリを自分のアカウントにコピーすること。 * クローン 自分のアカウントにあるリモートリポジトリをローカルにダウンロードすること。 * プッシュ リモートリポジトリに現在のローカルリポジトリのデータを上げる。 * プルリクエスト 分がした変更を取り込んでもらうように提案すること。 ## 学校のネットワークでエラーが出たら * [多分これかな?](https://qiita.com/ryotaro76/items/0e40ffb6173b1580e671) ## 読んでみると面白いかも * [君には1時間でGitについて知ってもらう](https://qiita.com/jesus_isao/items/63557eba36819faa4ad9) ## 個人的URL集(読まなくて良いよ) * https://qiita.com/numa08/items/b676e38e3dbabfd39d18

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully