0% found this document useful (0 votes)
7 views

Tech Talk

he
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Tech Talk

he
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB

$ mkdir testgit

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB


$ cd testgit

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit


$ git config --global --list
[email protected]

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit


$ git config --global user.name "Duong Minh Son"

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit


$ git config --global user.email "[email protected]"

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit


$ git config --global --list
[email protected]
user.name=Duong Minh Son

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit


$ git init
Initialized empty Git repository in C:/Users/Son
Duong/Downloads/Documents_FPT/CLB/testgit/.git/

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (master)


$ vi son.txt

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (master)


$ git status
On branch master

No commits yet

Untracked files:
(use "git add <file>..." to include in what will be committed)
son.txt

nothing added to commit but untracked files present (use "git add" to track)

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (master)


$ git add son.txt
warning: in the working copy of 'son.txt', LF will be replaced by CRLF the next
time Git touches it

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (master)


$ git status
On branch master

No commits yet

Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: son.txt

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (master)


$ git commit -m "add new file son.txt"
[master (root-commit) fc13558] add new file son.txt
1 file changed, 1 insertion(+)
create mode 100644 son.txt

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (master)


$ git log
commit fc1355866aa7b4531d4c48c0b7c913a1f38a7559 (HEAD -> master)
Author: Duong Minh Son <[email protected]>
Date: Tue Jan 23 20:07:34 2024 +0700

add new file son.txt

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (master)


$ git log --online
fatal: unrecognized argument: --online

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (master)


$ git log --oneline
fc13558 (HEAD -> master) add new file son.txt

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (master)


$ ^C

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (master)


$ git branch
* master

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (master)


$ git branch dev

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (master)


$ git branch
dev
* master

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (master)


$ git checkout dec
error: pathspec 'dec' did not match any file(s) known to git

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (master)


$ git checkout dev
Switched to branch 'dev'

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (dev)


$ vi long.txt

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (dev)


$ git log
commit fc1355866aa7b4531d4c48c0b7c913a1f38a7559 (HEAD -> dev, master)
Author: Duong Minh Son <[email protected]>
Date: Tue Jan 23 20:07:34 2024 +0700

add new file son.txt

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (dev)


$ git brand -M developer
git: 'brand' is not a git command. See 'git --help'.
The most similar command is
branch

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (dev)


$ gti branch -M developer
bash: gti: command not found

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (dev)


$ git branch -M developer

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (developer)


$ vi son.txt

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (developer)


$ git checkout developer
Already on 'developer'
M son.txt

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (developer)


$ git commit -m
error: switch `m' requires a value

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (developer)


$ git commit -M
error: unknown switch `M'
usage: git commit [<options>] [--] <pathspec>...

-q, --quiet suppress summary after successful commit


-v, --verbose show diff in commit message template

Commit message options


-F, --file <file> read message from file
--author <author> override author for commit
--date <date> override date for commit
-m, --message <message>
commit message
-c, --reedit-message <commit>
reuse and edit message from specified commit
-C, --reuse-message <commit>
reuse message from specified commit
--fixup [(amend|reword):]commit
use autosquash formatted message to fixup or amend/reword
specified commit
--squash <commit> use autosquash formatted message to squash specified
commit
--reset-author the commit is authored by me now (used with -C/-c/--
amend)
--trailer <trailer> add custom trailer(s)
-s, --signoff add a Signed-off-by trailer
-t, --template <file>
use specified template file
-e, --edit force edit of commit
--cleanup <mode> how to strip spaces and #comments from message
--status include status in commit message template
-S, --gpg-sign[=<key-id>]
GPG sign commit

Commit contents options


-a, --all commit all changed files
-i, --include add specified files to index for commit
--interactive interactively add files
-p, --patch interactively add changes
-o, --only commit only specified files
-n, --no-verify bypass pre-commit and commit-msg hooks
--dry-run show what would be committed
--short show status concisely
--branch show branch information
--ahead-behind compute full ahead/behind values
--porcelain machine-readable output
--long show status in long format (default)
-z, --null terminate entries with NUL
--amend amend previous commit
--no-post-rewrite bypass post-rewrite hook
-u, --untracked-files[=<mode>]
show untracked files, optional modes: all, normal, no.
(Default: all)
--pathspec-from-file <file>
read pathspec from file
--pathspec-file-nul with --pathspec-from-file, pathspec elements are
separated with NUL character

Son Duong@DESKTOP-5C77N04 MINGW64 ~/Downloads/Documents_FPT/CLB/testgit (developer)


$

You might also like