SlideShare a Scribd company logo
1 of 54
Download to read offline
SourceTreeで始める
Git
実践編
みなさん
Git使ってますか?
Gitを使うと…
             
    彡ハヽヽミ      
   ( ´・ω・`)   
   /     ヽ    
   / /    ヽ| 
  (_二つ    )   
   |      イ    
   |  l͡ヽ  ヽ     
こんな体が…
     彡 ͡ ミ
    ( ´・ω・`)
     ./ >- 、-ヽ  
   /丶ノ、_。.ノ ._。) 
  〈 、〈Y ,ーiー〈ト
    .\_ξ ~~~~~~Y
      |__/__|
     |、,ノ | 、_ノ
ムキムキになれます!
             
    彡ハヽヽミ      
   ( ´・ω・`)   
   /     ヽ    
   / /    ヽ| 
  (_二つ    )   
   |      イ    
   |  l͡ヽ  ヽ     
Git未使用
     彡 ͡ ミ
    ( ´・ω・`)
     ./ >- 、-ヽ  
   /丶ノ、_。.ノ ._。) 
  〈 、〈Y ,ーiー〈ト
    .\_ξ ~~~~~~Y
      |__/__|
     |、,ノ | 、_ノ
Git使用後
結果をコミットする
< Git >
そろそろ三桁が見えてます
今日はGitの使い方な
どについて
アジェンダ
• Gitのあるなしについて
• Gitの用語など
• ディレクトリ構成について
• 導入にあたって
• WordPressでの注意点
• 役割別に見るGit
Gitあるなしの環境
作業の流れ
• 編集
• アップロード
• 確認
• バックアップ
二人以上の作業
A「今から編集するよー」
「了解。どのファイルいじります?」B
A「hoge.phpいじりますー。」
A「編集&アップしました。」
「了解。DLしときます」B
二人以上の作業
A「今から編集するよー」
「了解。どのファイルいじります?」B
A「hoge.phpいじりますー。」
A「編集&アップしました。」
「了解。DLしときます」B
この間編集不可!
VCS未導入のデメリット
• 同時編集ができない
• 最新版の同期が必要
• 過去のバージョンに戻れない
用語など
Gitの用語
• リポジトリ
• クローン
• コミット
• プッシュ
• プル
• 衝突
リポジトリ
• ソースコードとかのファイルが入った入れ物
• 一つのプロジェクトに一つのリポジトリ
• 例) あの案件のリポジトリ、どこにあったっけ?
• 例) 手元のリポジトリにはファイル追加してある
なぁ。
クローン
• 親元のリポジトリから手元にコピーすること。
• 例) この案件のリポジトリ作っておいたから、ク
ローンしといて
コミット
• 作業を手元で保存すること。
• コミットの単位で履歴に残る。
• 例) 今日の作業分をコミットしとこう。
プッシュ
• 手元でコミットされた内容をサーバにアップロード
すること。
• 例) その変更点、プッシュしておいてね。
• 例) あっ、コミットはしたんですけど、まだ完成し
てないのでプッシュしてないです。
プル
• サーバから変更点をダウンロードすること。
• 例) こないだのバグ修正、プッシュしといたから、
プルしておいてね。
衝突
• 同じファイルの同じ箇所を同時に修正した場合
• 例) このページのテーブル、僕の方でも修正したの
で衝突したみたい。
Git用語だけど知らなくていいこと
• ブランチ、タグ
• チェックアウト
• マージ
• ヘッド
配置構成について
実際のディレクトリ構成
• WordPressのテーマディレクトリ
• プラグインディレクトリ
• デザインファイル
• その他エクセルファイルなど
• バックアップ
テーマディレクトリ
• themes以下で必要なディレクトリをまるごと
• 親テーマを使っている場合にはそちらも
• 名前はwptheme
プラグインディレクトリ
• 案件に向けて作成したディレクトリ
• インストールしたファイルは入れない
• 名前はwpplugins
デザイン系
• aiやpsdのデータ
• スライス、書き出ししたpng, jpg
• 名前はimgs
その他ファイル
• エクセル、ワードのデータ
• お客さんから送られてきたいろいろなファイル
• 参考資料となるpdfなど
• 名前はattachments
バックアップ
• データベースのダンプファイル
• WordPressのエクスポート
その他
• gitでクローンするディレクトリは一箇所
• 必要な箇所にシンボリックリンクなどで対処
• 必要な箇所 => XAMPPなど
• シンボリックリンク => エイリアス、ショート
カット)
実際のファイル構成を
紹介
導入にあたって
Gitの準備
• BitBucketのアカウントを取る
• https://bitbucket.org/
• SouceTreeをインストールする
Gitで案件スタート
1. 案件名を決める
2. リポジトリを作る
3. SourceTreeでクローンする
4. 作業する
5. コミット&プッシュ
6. プル
案件名を決める
• 案件名は結構重要
• ユニークで複雑ではないもの
時間があれば実際に
(15分ほど)
初回の導入にあたって
初回の導入にあたって
• 現状のファイルバックアップ+Gitの二段構え
• 二度手間になって時間がかかるけれど…
• 得られるものは多い!
• まずは少人数でコミットー>プッシュ
WordPressでの注意点
WordPressでの注意点
• 固定ページの投稿に書かない
• 複数人開発だと同期を取りづらい
• page-name.phpとしてテンプレートファイルでやり
とりすると楽
• ただし納品後お客さんにいじってもらうのであれば
投稿で作成もアリ
WordPressでの注意点
• 手書きでの相対パス、絶対パスは避ける
• ../hogehoge.html, /css/hoge.css
• <?php bloginfo(‘template_url’); ?>を使いましょう
WordPressでの注意点
• プリフィックスは設定しておくこと
• ユニークではないと他の案件と衝突する
• プリフィックスの変更は面倒
というわけで、
まずは気軽に始めてみませんか?
おつかれさまでした
役割別に見るGit
コーダーさん
• CSS、テンプレートファイルの管理
• コーダーが複数いる場合に特に力を発揮
デザイナーさん
• aiやpsdのデータをアップ
プログラマーさん
• テンプレートファイルなどを管理
• 他の職種がGitを使えるようにサポート(ここ重要)
ディレクターさん
• 全体管理
• 作業の割り振り
• 衝突発生時の折衝
• バックアップ
ひとりで
• もちろんなんでも
• 見積書
• 請求書
• サーバの設定ファイル

More Related Content

Recently uploaded

Recently uploaded (11)

NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

Source treeで始めるgit