The document outlines various Git commands and their usages, including initialization, adding files, committing changes, and managing branches. Key actions include committing with messages in Japanese, removing files, resetting changes, and checking out branches. It also describes the process of cloning repositories, fetching and pulling updates, and handling merges and rebases.
Version control systems like Git allow teams to collaborate on code by automatically backing up work, tracking changes over time, and easily sharing code between collaborators. Git uses repositories to store source code and a branching model like GitFlow to coordinate work between team members on features, releases, and hotfixes in a stable, collaborative way. Key concepts in Git include repositories, working copies, commits, updates, pulls, and pushes used to integrate changes between local and remote repositories.
This document provides an overview of version control systems and compares Git and SVN. It discusses why version control is useful, describes popular version control systems from the past and present, and highlights key differences between distributed (Git) and centralized (SVN) systems. The document also includes instructions for downloading, setting up, and using basic Git functions for managing a code repository, including commands for saving changes, inspecting history, undoing edits, syncing repositories, and working with branches.
Git is a distributed version control system designed to be efficient, support non-linear development (e.g. branching and merging), and work well on large projects with many developers collaborating simultaneously on the same files. It stores content in a data model of immutable objects (blobs, trees, commits) accessed through references like branches and tags. This allows it to efficiently track file history and versions across branches without duplicating data.
This document discusses Git flow and workflows for features, releases, and hotfixes. It explains how to start and finish these branches using git flow commands or equivalent Git commands. It also provides tips for publishing remote branches, dealing with obsolete branches, and fixing common mistakes like amending commits, resetting files, and recovering deleted local branches.
This document provides an overview of Git commands and workflows:
- It introduces basic Git commands for setting up a local repository, adding and committing files, viewing the status and differences between commits, ignoring files, and more.
- Common workflows are demonstrated including cloning a repository, making changes and committing them locally, and pushing changes to a remote repository.
- More advanced topics are covered like branching, merging, rebasing, resolving conflicts, and using tools to help with these processes.
- Configuration options and tips are provided to customize Git behavior and inspect repositories.
The document discusses two different Git workflow models: trunk-based development and Gitflow. Trunk-based development involves having all work done directly on the main branch, or trunk, allowing for frequent integration and simple continuous delivery. Gitflow involves having permanent branches for features, releases and hotfixes, with more complex branch and merge management. The document compares the pros and cons of each model based on factors like team experience, project maturity, and whether the code is open source.
Git rebase rewrites commit history by cutting commits from one branch and applying them to another branch, changing the commit IDs. This cleans up history but can cause issues if commits are pushed. Git merge keeps the original commits and adds a merge commit, keeping full history but potentially cluttering it. Rebase is best for local branches before pushing, while merge is better for integrating public branches to avoid rewriting shared history.
Le document présente une introduction à Git, un système de gestion de versions open source créé par Linus Torvalds, en expliquant ses principales caractéristiques et termes techniques. Il couvre l'installation, la configuration, et les bases du fonctionnement de Git, ainsi que des concepts comme le contr?le des versions, la gestion des branches, et les workflows. Enfin, il aborde des outils pour faciliter l'utilisation de Git et fournit des références pour approfondir le sujet.
The document outlines various Git commands and their usages, including initialization, adding files, committing changes, and managing branches. Key actions include committing with messages in Japanese, removing files, resetting changes, and checking out branches. It also describes the process of cloning repositories, fetching and pulling updates, and handling merges and rebases.
Version control systems like Git allow teams to collaborate on code by automatically backing up work, tracking changes over time, and easily sharing code between collaborators. Git uses repositories to store source code and a branching model like GitFlow to coordinate work between team members on features, releases, and hotfixes in a stable, collaborative way. Key concepts in Git include repositories, working copies, commits, updates, pulls, and pushes used to integrate changes between local and remote repositories.
This document provides an overview of version control systems and compares Git and SVN. It discusses why version control is useful, describes popular version control systems from the past and present, and highlights key differences between distributed (Git) and centralized (SVN) systems. The document also includes instructions for downloading, setting up, and using basic Git functions for managing a code repository, including commands for saving changes, inspecting history, undoing edits, syncing repositories, and working with branches.
Git is a distributed version control system designed to be efficient, support non-linear development (e.g. branching and merging), and work well on large projects with many developers collaborating simultaneously on the same files. It stores content in a data model of immutable objects (blobs, trees, commits) accessed through references like branches and tags. This allows it to efficiently track file history and versions across branches without duplicating data.
This document discusses Git flow and workflows for features, releases, and hotfixes. It explains how to start and finish these branches using git flow commands or equivalent Git commands. It also provides tips for publishing remote branches, dealing with obsolete branches, and fixing common mistakes like amending commits, resetting files, and recovering deleted local branches.
This document provides an overview of Git commands and workflows:
- It introduces basic Git commands for setting up a local repository, adding and committing files, viewing the status and differences between commits, ignoring files, and more.
- Common workflows are demonstrated including cloning a repository, making changes and committing them locally, and pushing changes to a remote repository.
- More advanced topics are covered like branching, merging, rebasing, resolving conflicts, and using tools to help with these processes.
- Configuration options and tips are provided to customize Git behavior and inspect repositories.
The document discusses two different Git workflow models: trunk-based development and Gitflow. Trunk-based development involves having all work done directly on the main branch, or trunk, allowing for frequent integration and simple continuous delivery. Gitflow involves having permanent branches for features, releases and hotfixes, with more complex branch and merge management. The document compares the pros and cons of each model based on factors like team experience, project maturity, and whether the code is open source.
Git rebase rewrites commit history by cutting commits from one branch and applying them to another branch, changing the commit IDs. This cleans up history but can cause issues if commits are pushed. Git merge keeps the original commits and adds a merge commit, keeping full history but potentially cluttering it. Rebase is best for local branches before pushing, while merge is better for integrating public branches to avoid rewriting shared history.
Le document présente une introduction à Git, un système de gestion de versions open source créé par Linus Torvalds, en expliquant ses principales caractéristiques et termes techniques. Il couvre l'installation, la configuration, et les bases du fonctionnement de Git, ainsi que des concepts comme le contr?le des versions, la gestion des branches, et les workflows. Enfin, il aborde des outils pour faciliter l'utilisation de Git et fournit des références pour approfondir le sujet.
6. リポジトリの作成
git init
$ cd HelloApp
$ git init
local repository
6
7. リポジトリへの登録
git add, git commit
working tree index local repository
hello.c hello.c hello.c
Make?le Make?le Make?le
git add git commit
git commit -m "Message"
7
8. 管理外のファイルを无视する
.gitignore
working tree index local repository
hello.c hello.c hello.c
Make?le Make?le Make?le
hello.o
hello
.gitignore
hello.o
hello
8
9. 差分を出力する
git diff
working tree index local repository
hello.c hello.c hello.c
Make?le Make?le Make?le
hello.o git diff git diff HEAD
hello
HEADは最新コミット
.gitignore .gitignore .gitignore
9
11. コミットをなかったことにする
git reset
HEAD^^^ HEAD^^ HEAD^ HEAD
38a123~ 4a8931~ 13ea90~ 124b34~
A B C D 最新コミット
git reset --hard HEAD^^
HEAD^ HEAD
38a123~ 4a8931~
A B 最新コミット
11
12. コミットをなかったことにする
git reset
working tree index local repository
hello.c hello.c hello.c
git reset --soft HEAD^
ワーキングツリー
は影響無し
foo.c foo.c foo.c
git reset --mixed HEAD^
12
13. コミットを前の状态に戻す
git revert
HEAD^^^ HEAD^^ HEAD^ HEAD
38a123~ 4a8931~ 13ea90~ 124b34~
A B C D 最新コミット
$ git revert HEAD^^
$ git commit -m "E" Bのコミット
状態で最新
「変更」の履歴が残る
38a123~ 4a8931~ 13ea90~ 124b34~ 342b34~
A B C D E
13
14. ブランチを利用する
git branch, git checkout
A B masterブランチ
C develブランチ
$ git branch devel master 「branch」…ブランチの作成
$ git checkout devel
: 「checkout」…ブランチの切替え
$ git commit -am "C"
14
15. ブランチのマージ
git merge
master
A B E ブランチ
マージ
C D
devel
ブランチ
$ git checkout master
$ git merge devel
15
16. ブランチのマージ
git merge
master
A B D F ブランチ
マージ
C E
devel
ブランチ
$ git checkout master
$ git merge devel
<コンフリクトが起こる可能性有り>
16
17. ブランチのリベース
git rebase
master
A B D ブランチ
devel
C E ブランチ
$ git checkout devel
$ git rebase master
A B D masterブランチに追従
devel
C' E' ブランチ
17