Git Product home page Git Product logo

pull_request_sample's Introduction

pull_requestの練習リポジトリ

リンクの文字 Markdownで行こう!

git -> Githubへのpush(流れ)

  1. ローカル上でデイレクトリ作成(プロジェクト)
  2. ディレクトリ内でgit initコマンドを使い初期化
  3. 何かしらの作成 or 編集
  4. 更新したものをステージングエリアに上げる
  5. git commit -m "コメント"で変更を保存する
  6. Github上でリモートリポジトリを作成
  7. git remote add と git pushのコマンドをコピー
  8. git remote add origin git hubのurlコマンドでローカルとリモートを接続
  9. git push -u origin masterコマンドで保存したソースコードをリモートへ送る

pullの流れ

  1. リモートリポジトリをローカルリポジトりより育てる
  2. git pull origin masterコマンドでリモート上の最新リポジトリをローカルに持ってくる

pull Requesrtの流れ

  1. git checkout -b ブランチ名コマンドで新規ブランチを作成(同時にブランチの切り替えも行ってくれる)
  2. 何かしらのアップデートをする
  3. git add ., git commit -m "コメント"の順で保存する
  4. git push origin 新しいブランチ名コマンドでリモート上に新しくブランチを作成してpush
  5. Github上でpull requestを送る
  6. 管理者がレビューする
  7. 問題があれば差し戻す
  8. 再度問題を確認し、add, commit, pushで修正内容をpull reqに上乗せして送る
    • pull req中に同じブランチに修正内容をpushすると修正内容がPull reqに乗っかる
  9. 修正内容を確認し、mergeする
  10. ブランチを削除する

ブランチの切り替え方

  • git checkout ブランチ名コマンドでブランチを行き来できる
    • 現在いるランチ上で何かしたらの変更を行っていた場合はその変更内容を保存もしくは削除してからブランチを切移動すること

commitコメントの修正

  • git commit --amend -m "新規コメント" コマンドで編集可能

指定したコミットまでコードを遡る方法

  1. Github上(もしくはlog上)でコミットのハッシュをコピー
  2. git checkout ハッシュ コマンドで指定したコミットまで戻る
  3. git checkout ブランチ名 コマンドで最新のコミットに戻る

###別ブランチのコミット#masterブランチへ追加する方法

  1. 別ブランチでの変更をコミットしきる
  2. git log --online でコミットのハッシュを見る
  3. git checkout masterでmasterブランチへ移動
  4. git check cherry-pick ハッシュでコミットをmasterへ追加

ローカルブランチの削除

  • git branch -d ブランチ名
  • error: The branch 'ブランチ名' is not fully merged.が出れば、 +git branch -D ブランチ名で強制削除も可能

pull_request_sample's People

Contributors

koichitakashiro avatar

Watchers

James Cloos avatar  avatar

pull_request_sample's Issues

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.