Author: alpha74
-
Uses a single branch.
-
Team members have local copies of project.
-
Cons:
- Features related to branching and PRs are not used.
-
Work is done on feature/topic branches.
-
feature branch is merged in base branch.
-
Uses a single remote repo.
-
Pros:
- Uses branching and PRs.
-
Involves multiple remote repos.
-
One of the remote repo is considered
upstream
from all, and is considered source of truth . -
Work is transfered from
remote
repo toupstream
repo using PR. -
Mostly used in OSS.
-
Pros:
- User of forked repo does not need to have
write-access
toupstream
repo.
- User of forked repo does not need to have
-
Cons:
- Forked repo can become un-sync with
upstream
.
- Forked repo can become un-sync with
-
Allows safe continues releases of project.
-
Involves two or more long running branches like:
release
,master
,develop
. -
And short duration branches like:
featureX
,topicA
,hotfix-1
. -
Some Rules:
- Only merge commit on
master
. - Commit to
master
only fromrelease
orhotfix
branch. develop
branch then adds a merge commit fromrelease
branch, if committed tomaster
.
- Only merge commit on
cat file
check-ignore
commit-tree
count-objects
diff-index
for-each-ref
hash-object
ls-files
merge-base
read-tree
rev-list
rev-parse
show-ref
symbolic-ref
update-index
update-ref
verify-pack
write-tree
git diff
: See the difference of changes made to the directory(shows only when commits are not made after changes).git diff <filename>
: Same for specific file.git diff -staged
: See all difference of changes made to the directory, after staging is done.2