Git

Get Started. It's Free
or sign up with your email address
Rocket clouds
Git by Mind Map: Git

1. RM

1.1. stage a file to be removed from local repo and workspace

1.1.1. $_git_rm_<file_name>

2. Add

2.1. add a file(s) to index

2.1.1. $_git_add_<file_name>

2.2. add all new & changed files to index

2.2.1. $_git_add_.

3. Branch

3.1. create a new local branch

3.1.1. $_git_branch_<branch_name>

3.2. show all local branches

3.2.1. $_git_branch

3.3. switch to a local branch

3.3.1. $_git_checkout_<branch_name>

3.4. create a new branch & checkout

3.4.1. $_git_checkout_-b_<branch_name>

3.5. delete a local branch after merging

3.5.1. $_git_branch_-d_<branch_name>

3.6. delete a local branch without merging

3.6.1. $_git_branch_-D_<branch_name>

3.7. rename a branch

3.7.1. $_git_branch_-m/-M_<old>_<new>

3.8. remove a remote branch

3.8.1. $_git_push_origin_:<banch>

4. Commit

4.1. commit staged changes

4.1.1. $_git_commit

4.2. commit from workspace to local repo

4.2.1. $_git_commit_-a

4.3. commit with a specified message

4.3.1. $_git_commit_-m_<message>

4.4. show diff when creating message

4.4.1. $_git_commit_-v

5. Diff/ls-files

5.1. show cached files

5.1.1. $_git_ls-files

5.2. diff working and index

5.2.1. $_git_diff

5.3. diff working and HEAD

5.3.1. $_git_diff_HEAD

5.4. diff index and HEAD

5.4.1. $_git_diff_--cached

6. Merge

6.1. merge current branch w/ other branch

6.1.1. $_git_merge_<branch_name>

6.2. setup diffmerge

6.2.1. $_git_mergetool_-t_diffmerge

7. Log/Blame

7.1. show log

7.1.1. $_git_log

7.2. show blame info

7.2.1. $_git_blame_<file_name>

8. Amend/Revert/Reset

8.1. amend

8.1.1. $_git_commit_--amend

8.2. revert

8.2.1. $_git_revert

8.3. reset

8.3.1. $_git_reset

9. Stash

10. Rebase

10.1. $_git_rebase

11. Workflows

11.1. create a branch from an origin branch

11.1.1. git remote update

11.1.2. git checkout -b <branch> origin/<branch>

11.1.3. git pull origin <branch>