$ git clone https://github.com/quangns/test.git
$ cd test
$ git remote rename origin github#Tạo file script, viết code & commit
$ echo "print 'Hello world!'" > hello_world.py
$ git add hello_world.py
$ git commit -m "Add: Hello world script"
$ git push -u github master#Mấy lệnh git hay dùng
Lấy code mới về
$ git pull --rebase gitlab masterPush code ở local lên
$ git push origin masterXem trạng thái git hiện tại
$ git statusXem commit log
$ git logAdd các file vào git
$ git add --allDùng: Abc: Message hoặc: Abc: Message
Description Trong đó: Abc là Add, Mod(ify), Ref(actoring), Fix, Rem(ove) và Rea(dability) Ví dụ: Add: New function to rule the world Mod: Add women factor in Domination.ruleTheWorld() Ref: Extract empathy stuff to an abstract class Fix: RUL-42 or #42 Starvation need to be initialised before Energy to avoid the nullpointer in People Rem: freeSpeech is not used anymore Rea: Removed old TODO and extra space in header Dùng pre-commit để fix mấy lỗi coding & writing style
Cài pre-commit $ sudo pip install pre-commit Test & tự động fix mấy lỗi trình bày cơ bản: $ pre-commit run --files nguyen_sy_quang/