- Understand Git and VCS fundamentals (Version Control System)
- Install and configure Git
- Using Git to control version during application development life cycle
- Working with GitHub
[Slide]
-
Video: https://drive.google.com/drive/folders/1L06VxvUJdeKbEfgUdfMifL2gL4hFe33t
-
Reference: https://drive.google.com/drive/folders/1EBNT8RL-S9gMaEESVNxOz3LQD2st318G
[References]
- http://git-scm.com/book - the first 4 chapters
- http://backlogtool.com/git-guide/vn/intro/intro1_1.html
- https://learngitbranching.js.org/ - Tool to practice git branch
- http://chris.beams.io/posts/git-commit/
[Video]
[Note]
- Trainees use company email (if any) or personal email registered with HR to register for an account.
- Trainees have to set the account name similar to your account chatwork name
- For Malaysia training course, Trainees use the personal email registered with Mentor to create an account at this link: https://github.com/
Host: http://training.sun-asterisk.vn
Account: Use personal mail to register for an account
NOTE: You must set an account similar to your account chatwork
For example:
Full name: Nguyen Van A
Account name: [Malay_Ruby] Nguyen Van A
-
"Let's go together"
- before run command
git checkout
, must rungit status
- run
git log --oneline
beforegit commit
- before run command
-
when to use commit -m and commit --amend
git commit -m "content comment"
// for the first commitgit commit --amend
// for the 2nd commit onwards.how do you know that be the first commit?
-> you run the command
git log --oneline
-
Error more many commits in a pull request:
Practice: executing rebase 2 commits in the pull request
git rebase -i HEAD ~ 2 // read and follow the instructions in terminal
-
Before pushing the code to github, remember to rebase with branch master - the latest
stand at your branch
git rebase develop
- with conflict: fix conflict -> git add -A -> git rebase --continue
- no conflict:
git push origin name_branch
-
Missed to push an unnecessary file / folder onto the pull request
// file git rm --cached file_name // folder git rm -r --cached folder
-
Accidentally fixed the wrong branch comment (yaoming)
Step 1. If you run
git commit
not yet, you just git checkout to branchStep 2. If you run commit command, you run
git reflog
Select the commit you want to return
git reset id_commit
then follow the Step 1Also, you can learn more
git reset