Open mvn-vyle-dn opened 6 years ago
$ git init Create an empty Git repository or reinitialize an existing one
$ git init
$ git@github.com:at-quangtran/GIT-PHP.git Clone a repository into a new directory
$ git@github.com:at-quangtran/GIT-PHP.git
$ git branch List all branches
$ git branch
$ git checkout new_branch Create a new branch
$ git checkout new_branch
$ git branch -d new_branch Delete a branch
$ git branch -d new_branch
$ git checkout -b new_branch Create and switch a new branch
$ git checkout -b new_branch
$ git add index.html Add file contents to the index
$ git add index.html
$ git commit -m "commit lan 1" Add file contents to the index
$ git commit -m "commit lan 1"
$ git commit --amend Amend commit message
$ git commit --amend
$ git log Show commit logs
$ git log
$ git diff master develop Show changes between commits, commit and working tree, etc
$ git diff master develop
$ git diff master:./index.html develop:./index.html
$ git checkout master -- index.html
$ git reset Reset current HEAD to the specified state
$ git reset
$ git checkout e72af7d Revert some existing commits
$ git checkout e72af7d
$ git log --oneline Show commit logs in a single line
$ git log --oneline
$ git fetch origin vy Download objects and refs from another repository
$ git fetch origin vy
$ git pull origin vy Fetch from and integrate with another repository or a local branch
$ git pull origin vy
$ git push origin vy Update remote refs along with associated objects
$ git push origin vy
git init
$ git init
Create an empty Git repository or reinitialize an existing onegit clone
$ git@github.com:at-quangtran/GIT-PHP.git
Clone a repository into a new directorygit branch
$ git branch
List all branchesTạo branch
$ git checkout new_branch
Create a new branchDelete branch
$ git branch -d new_branch
Delete a branch$ git checkout -b new_branch
Create and switch a new branchgit add
$ git add index.html
Add file contents to the indexgit commit
$ git commit -m "commit lan 1"
Add file contents to the indexgit commit --amend
$ git commit --amend
Amend commit messagegit log
$ git log
Show commit logsgit diff
$ git diff master develop
Show changes between commits, commit and working tree, etc$ git diff master:./index.html develop:./index.html
checkout 1 file
$ git checkout master -- index.html
git reset
$ git reset
Reset current HEAD to the specified stategit revert
$ git checkout e72af7d
Revert some existing commitsgit log --oneline
$ git log --oneline
Show commit logs in a single linegit fetch
$ git fetch origin vy
Download objects and refs from another repositorygit pull
$ git pull origin vy
Fetch from and integrate with another repository or a local branchgit push
$ git push origin vy
Update remote refs along with associated objectstạo conflict
resovle conflict