development:system:git
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
development:system:git [2024/08/12 09:40] – ["Warning: the ECDSA host key for 'github.com' differs from the key for the IP address" issue] tungnt | development:system:git [2024/08/15 09:03] (current) – tungnt | ||
---|---|---|---|
Line 51: | Line 51: | ||
Identity added: / | Identity added: / | ||
$ ssh-add -l | $ ssh-add -l | ||
- | 4096 SHA256:HntA0FUgaD0ELTaHSU/ | + | 4096 SHA256:HntA0FUgaD0***EjnP6aXyCvM |
- | 4096 SHA256:2cJDMSnLCJPnd6K4cIdjmI58FwJ/ | + | 4096 SHA256:2cJDMSnLCJP***Wrml4S8ulHw |
</ | </ | ||
Line 62: | Line 62: | ||
| | ||
ssh-add / | ssh-add / | ||
- | ssh-add / | ||
ssh-add / | ssh-add / | ||
Line 141: | Line 140: | ||
https:// | https:// | ||
+ | |||
+ | ====== GitFlow ====== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | {{: | ||
+ | |||
+ | https:// | ||
+ | |||
+ | <code bash> | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 1site % mkdir gitflow | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 1site % cd gitflow | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % ls -la | ||
+ | total 0 | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x@ 7 tungnt | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % echo "# gitflow" | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git init | ||
+ | Initialized empty Git repository in / | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git add README.md | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git commit -m "first commit" | ||
+ | [master (root-commit) 0f7d8f6] first commit | ||
+ | 1 file changed, 1 insertion(+) | ||
+ | | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch -M main | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git remote add origin git@github.com: | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git push -u origin main | ||
+ | Enumerating objects: 3, done. | ||
+ | Counting objects: 100% (3/3), done. | ||
+ | Writing objects: 100% (3/3), 290 bytes | 290.00 KiB/s, done. | ||
+ | Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 | ||
+ | To github.com: | ||
+ | * [new branch] | ||
+ | branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch develop | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch | ||
+ | develop | ||
+ | * main | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout develop | ||
+ | Switched to branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout main | ||
+ | Switched to branch ' | ||
+ | Your branch is up to date with ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git push -u origin develop | ||
+ | Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 | ||
+ | remote: | ||
+ | remote: Create a pull request for ' | ||
+ | remote: | ||
+ | remote: | ||
+ | To github.com: | ||
+ | * [new branch] | ||
+ | branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout -b feature/ | ||
+ | Switched to a new branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git status | ||
+ | On branch feature/ | ||
+ | Untracked files: | ||
+ | (use "git add < | ||
+ | test.js | ||
+ | |||
+ | nothing added to commit but untracked files present (use "git add" to track) | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git add test.js | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git commit -m '#1 - add a new test.js file' | ||
+ | [feature/ | ||
+ | 1 file changed, 1 insertion(+) | ||
+ | | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git push | ||
+ | fatal: The current branch feature/ | ||
+ | To push the current branch and set the remote as upstream, use | ||
+ | |||
+ | git push --set-upstream origin feature/ | ||
+ | |||
+ | To have this happen automatically for branches without a tracking | ||
+ | upstream, see ' | ||
+ | |||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git push --set-upstream origin feature/ | ||
+ | Enumerating objects: 4, done. | ||
+ | Counting objects: 100% (4/4), done. | ||
+ | Delta compression using up to 8 threads | ||
+ | Compressing objects: 100% (2/2), done. | ||
+ | Writing objects: 100% (3/3), 399 bytes | 399.00 KiB/s, done. | ||
+ | Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 | ||
+ | remote: | ||
+ | remote: Create a pull request for ' | ||
+ | remote: | ||
+ | remote: | ||
+ | To github.com: | ||
+ | * [new branch] | ||
+ | branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout develop | ||
+ | Switched to branch ' | ||
+ | Your branch is up to date with ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git pull | ||
+ | remote: Enumerating objects: 1, done. | ||
+ | remote: Counting objects: 100% (1/1), done. | ||
+ | remote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0 | ||
+ | Unpacking objects: 100% (1/1), 906 bytes | 906.00 KiB/s, done. | ||
+ | From github.com: | ||
+ | | ||
+ | Updating 0f7d8f6..e94388a | ||
+ | Fast-forward | ||
+ | | ||
+ | 1 file changed, 1 insertion(+) | ||
+ | | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout release-1.0.0 develop | ||
+ | error: pathspec ' | ||
+ | error: pathspec ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout -b release-1.0.0 develop | ||
+ | Switched to a new branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git tag ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git push --tags | ||
+ | Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 | ||
+ | To github.com: | ||
+ | * [new tag] | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git merge develop | ||
+ | Already up to date. | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch | ||
+ | develop | ||
+ | feature/ | ||
+ | main | ||
+ | * release-1.0.0 | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git push origin release-1.0.0 | ||
+ | Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 | ||
+ | remote: | ||
+ | remote: Create a pull request for ' | ||
+ | remote: | ||
+ | remote: | ||
+ | To github.com: | ||
+ | * [new branch] | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout main | ||
+ | Switched to branch ' | ||
+ | Your branch is up to date with ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % ls -la | ||
+ | total 8 | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x@ | ||
+ | drwxr-xr-x | ||
+ | -rw-r--r-- | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git pull origin main | ||
+ | remote: Enumerating objects: 1, done. | ||
+ | remote: Counting objects: 100% (1/1), done. | ||
+ | remote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0 | ||
+ | Unpacking objects: 100% (1/1), 890 bytes | 445.00 KiB/s, done. | ||
+ | From github.com: | ||
+ | * branch | ||
+ | | ||
+ | Updating 0f7d8f6..9cd0401 | ||
+ | Fast-forward | ||
+ | | ||
+ | 1 file changed, 1 insertion(+) | ||
+ | | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % ls -la | ||
+ | total 16 | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x@ | ||
+ | drwxr-xr-x | ||
+ | -rw-r--r-- | ||
+ | -rw-r--r-- | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git tag ' | ||
+ | fatal: tag ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git push --tags | ||
+ | Everything up-to-date | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch | ||
+ | develop | ||
+ | feature/ | ||
+ | * main | ||
+ | release-1.0.0 | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch -d release-1.0.0 | ||
+ | Deleted branch release-1.0.0 (was e94388a). | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git push origin -d release-1.0.0 | ||
+ | To github.com: | ||
+ | - [deleted] | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch -d feature/ | ||
+ | Deleted branch feature/ | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git push origin -d feature/ | ||
+ | To github.com: | ||
+ | - [deleted] | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout -b hotfixs main | ||
+ | Switched to a new branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git add test.js | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git commit -m '#1 - Hotfix test' | ||
+ | [hotfixs c16aab1] #1 - Hotfix test | ||
+ | 1 file changed, 1 insertion(+), | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git push origin hotfixs | ||
+ | Enumerating objects: 5, done. | ||
+ | Counting objects: 100% (5/5), done. | ||
+ | Delta compression using up to 8 threads | ||
+ | Compressing objects: 100% (2/2), done. | ||
+ | Writing objects: 100% (3/3), 395 bytes | 395.00 KiB/s, done. | ||
+ | Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 | ||
+ | remote: | ||
+ | remote: Create a pull request for ' | ||
+ | remote: | ||
+ | remote: | ||
+ | To github.com: | ||
+ | * [new branch] | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout main | ||
+ | Switched to branch ' | ||
+ | Your branch is up to date with ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch -D hotfixs | ||
+ | Deleted branch hotfixs (was c16aab1). | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git push origin -d hotfixs | ||
+ | To github.com: | ||
+ | - [deleted] | ||
+ | </ | ||
+ | |||
+ | ====== Git Rebase & Git Merge ====== | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | <code bash> | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch | ||
+ | develop | ||
+ | * main | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout -b test1 | ||
+ | Switched to a new branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout -b test2 | ||
+ | Switched to a new branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout test1 | ||
+ | Switched to branch ' | ||
+ | |||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % touch t1.md | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git add . | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git commit -m ' | ||
+ | [test1 d4dd238] T1 | ||
+ | 1 file changed, 0 insertions(+), | ||
+ | | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git log --oneline | ||
+ | d4dd238 (HEAD -> test1) T1 | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % touch t2.md | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git add . | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git commit -m ' | ||
+ | [test1 cfeb1a6] T2 | ||
+ | 1 file changed, 0 insertions(+), | ||
+ | | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % touch t3.md | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git add . | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git commit -m ' | ||
+ | [test1 a371709] T3 | ||
+ | 1 file changed, 0 insertions(+), | ||
+ | | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git log --oneline | ||
+ | a371709 (HEAD -> test1) T3 | ||
+ | cfeb1a6 T2 | ||
+ | d4dd238 T1 | ||
+ | |||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout -b test2 | ||
+ | Switched to a new branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git log --oneline | ||
+ | a371709 (HEAD -> test2, test1) T3 | ||
+ | cfeb1a6 T2 | ||
+ | d4dd238 T1 | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % echo ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git add . | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git commit -m ' | ||
+ | [test2 ab9eacf] T4 | ||
+ | 1 file changed, 1 insertion(+) | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git log --oneline | ||
+ | ab9eacf (HEAD -> test2) T4 | ||
+ | a371709 (test1) T3 | ||
+ | cfeb1a6 T2 | ||
+ | d4dd238 T1 | ||
+ | |||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout test1 | ||
+ | Switched to branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % cat t1.md | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % echo ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git add . | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git commit -m ' | ||
+ | [test1 54f6b26] T5 | ||
+ | 1 file changed, 1 insertion(+) | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git log --oneline | ||
+ | 54f6b26 (HEAD -> test1) T5 | ||
+ | a371709 T3 | ||
+ | cfeb1a6 T2 | ||
+ | d4dd238 T1 | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % echo ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git add . | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git commit -m ' | ||
+ | [test1 6e2e921] T6 | ||
+ | 1 file changed, 1 insertion(+) | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git log --oneline | ||
+ | 6e2e921 (HEAD -> test1) T6 | ||
+ | 54f6b26 T5 | ||
+ | a371709 T3 | ||
+ | cfeb1a6 T2 | ||
+ | d4dd238 T1 | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout test2 | ||
+ | Switched to branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % echo ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git add . | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git commit -m ' | ||
+ | [test2 d3eae48] T7 | ||
+ | 1 file changed, 1 insertion(+) | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git log --oneline | ||
+ | d3eae48 (HEAD -> test2) T7 | ||
+ | ab9eacf T4 | ||
+ | a371709 T3 | ||
+ | cfeb1a6 T2 | ||
+ | d4dd238 T1 | ||
+ | |||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch | ||
+ | develop | ||
+ | main | ||
+ | test1 | ||
+ | * test2 | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout -b test2_bk | ||
+ | Switched to a new branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout test1 | ||
+ | Switched to branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout -b test1_bk | ||
+ | Switched to a new branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch | ||
+ | develop | ||
+ | main | ||
+ | test1 | ||
+ | * test1_bk | ||
+ | test2 | ||
+ | test2_bk | ||
+ | | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout test1 | ||
+ | Switched to branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git merge test2 | ||
+ | Auto-merging t1.md | ||
+ | CONFLICT (content): Merge conflict in t1.md | ||
+ | Automatic merge failed; fix conflicts and then commit the result. | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git add . | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git commit -m 'merge for test1 from test2' | ||
+ | [test1 dec26bf] merge for test1 from test2 | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git log --oneline | ||
+ | dec26bf (HEAD -> test1) merge for test1 from test2 | ||
+ | d3eae48 (test2_bk, test2) T7 | ||
+ | 6e2e921 (test1_bk) T6 | ||
+ | 54f6b26 T5 | ||
+ | ab9eacf T4 | ||
+ | a371709 T3 | ||
+ | cfeb1a6 T2 | ||
+ | d4dd238 T1 | ||
+ | |||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch | ||
+ | develop | ||
+ | main | ||
+ | * test1 | ||
+ | test1_bk | ||
+ | test2 | ||
+ | test2_bk | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout test1_bk | ||
+ | Switched to branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch -D test1 | ||
+ | Deleted branch test1 (was dec26bf). | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout -b test1 | ||
+ | Switched to a new branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch -D test2 | ||
+ | Deleted branch test2 (was d3eae48). | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout test2_bk | ||
+ | Switched to branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout -b test2 | ||
+ | Switched to a new branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout test1 | ||
+ | Switched to branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git branch | ||
+ | develop | ||
+ | main | ||
+ | * test1 | ||
+ | test1_bk | ||
+ | test2 | ||
+ | test2_bk | ||
+ | |||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git rebase test2 | ||
+ | Auto-merging t1.md | ||
+ | CONFLICT (content): Merge conflict in t1.md | ||
+ | error: could not apply 54f6b26... T5 | ||
+ | hint: Resolve all conflicts manually, mark them as resolved with | ||
+ | hint: "git add/rm < | ||
+ | hint: You can instead skip this commit: run "git rebase --skip" | ||
+ | hint: To abort and get back to the state before "git rebase", | ||
+ | Could not apply 54f6b26... T5 | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git add . | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git rebase --continue | ||
+ | [detached HEAD e245d41] T5 - Version 2 | ||
+ | 1 file changed, 1 insertion(+) | ||
+ | Successfully rebased and updated refs/ | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git log --oneline | ||
+ | a16f04e (HEAD -> test1) T6 | ||
+ | e245d41 T5 - Version 2 | ||
+ | d3eae48 (test2_bk, test2) T7 | ||
+ | ab9eacf T4 | ||
+ | a371709 T3 | ||
+ | cfeb1a6 T2 | ||
+ | d4dd238 T1 | ||
+ | |||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git checkout test2_bk | ||
+ | Switched to branch ' | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git rebase test1_bk | ||
+ | Auto-merging t1.md | ||
+ | CONFLICT (content): Merge conflict in t1.md | ||
+ | error: could not apply ab9eacf... T4 | ||
+ | hint: Resolve all conflicts manually, mark them as resolved with | ||
+ | hint: "git add/rm < | ||
+ | hint: You can instead skip this commit: run "git rebase --skip" | ||
+ | hint: To abort and get back to the state before "git rebase", | ||
+ | Could not apply ab9eacf... T4 | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git add . | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git rebase --continue | ||
+ | [detached HEAD eec7eb5] T4 - Version 2 | ||
+ | 1 file changed, 1 insertion(+) | ||
+ | Successfully rebased and updated refs/ | ||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 gitflow % git log --oneline | ||
+ | e4d0fc8 (HEAD -> test2_bk) T7 | ||
+ | eec7eb5 T4 - Version 2 | ||
+ | 6e2e921 (test1_bk) T6 | ||
+ | 54f6b26 T5 | ||
+ | a371709 T3 | ||
+ | cfeb1a6 T2 | ||
+ | d4dd238 T1 | ||
+ | </ | ||
+ | |||
+ | * git merge: khi xem log các commit sẽ được sắp xếp theo thời gian commit, dùng khi dự án ít người cùng làm. | ||
+ | * git rebase: khi xem log các commit sẽ không sắp xếp theo thời gian commit như git merge, mà sẽ ưu tiên commit của cá nhân lên đầu. Nên sử dụng khi dự án có nhiều người cùng làm. | ||
+ | |||
+ | ====== Git Log ====== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | <code bash> | ||
+ | % git log --oneline | ||
+ | |||
+ | % git log -- filename modules/ | ||
+ | % git log -p -- filename modules/ | ||
+ | |||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 api.9s.vn % git log --pretty=format:" | ||
+ | 56e4d7fe03 - tungnt.blue@gmail.com, | ||
+ | b668bd133d - tungnt.blue@gmail.com, | ||
+ | 54327213ec - tungnt.blue@gmail.com, | ||
+ | 50db75fa85 - tungnt.blue@gmail.com, | ||
+ | ae02e78fb4 - tungnt.blue@gmail.com, | ||
+ | eaae3faa6f - tungnt.blue@gmail.com, | ||
+ | 7656495fc8 - tungnt.blue@gmail.com, | ||
+ | b0ffc56c41 - tungnt.blue@gmail.com, | ||
+ | 1958516401 - tungnt.blue@gmail.com, | ||
+ | 6ecef6fb81 - tungnt.blue@gmail.com, | ||
+ | cd02aafff4 - tungnt.blue@gmail.com, | ||
+ | 2dcbc9cdb7 - tungnt.blue@gmail.com, | ||
+ | 7dae86672a - tungnt.blue@gmail.com, | ||
+ | 7974263273 - tungnt.blue@gmail.com, | ||
+ | |||
+ | tungnt@MacBook-Pro-cua-Nguyen-2 api.9s.vn % git show 54327213ec | ||
+ | commit 54327213ec68b3e8e75194653a60bb95f9f09e5a | ||
+ | Author: tungnt < | ||
+ | Date: Tue Mar 12 16:44:03 2024 +0700 | ||
+ | |||
+ | Test TCB | ||
+ | |||
+ | diff --git a/ | ||
+ | index 9b98620801..1bbac43c4c 100644 | ||
+ | --- a/ | ||
+ | +++ b/ | ||
+ | @@ -47,11 +47,11 @@ class ExampleController extends BaseController | ||
+ | |||
+ | | ||
+ | |||
+ | - $sign1 = $this-> | ||
+ | - $sign2 = $this-> | ||
+ | + $sign1 = $this-> | ||
+ | + $sign2 = $this-> | ||
+ | |||
+ | - $verify1 = $this-> | ||
+ | - $verify2 = $this-> | ||
+ | + $verify1 = $this-> | ||
+ | + $verify2 = $this-> | ||
+ | |||
+ | | ||
+ | } | ||
+ | </ | ||
====== Một số lỗi có thể gặp ====== | ====== Một số lỗi có thể gặp ====== | ||
Line 151: | Line 624: | ||
https:// | https:// | ||
- | |||
- | ====== GitFlow ====== | ||
- | |||
- | {{: | ||
- | |||
- | https:// |
development/system/git.1723455628.txt.gz · Last modified: 2024/08/12 09:40 by tungnt