git status
On branch bthss_V3.0.4
Changes not staged for commit:// 已修改,未暂存的文件(use "git add <file>..." to update what will be committed)(use "git checkout -- <file>..." to discard changes in working directory)
modified: ReleaseNote.txt
Untracked files:// 新增的文件,未追踪的(use "git add <file>..." to include in what will be committed)
test.txt
no changes added to commit (use "git add" and/or "git commit -a")
状态:已暂存(git add)
git add ,变为已暂存状态,提交到暂存区
// 提交
$ git add .// 查看状态
$ git status
On branch bthss_V3.0.4
Changes to be committed:// 暂存待提交(use "git reset HEAD <file>..." to unstage)
modified: ReleaseNote.txt // 修改newfile: test.txt // 新增
状态:已提交(git commit)
git commit,变为已提交状态,提交到本地仓库
Git 提供了一个跳过使用暂存区域的方式, 只要在提交的时候,给 git commit 加上 -a 选项
$ git status
On branch bthss_V3.0.4
Your branch is ahead of 'origin/bthss_V3.0.4' by 2 commits.(use "git push" to publish your local commits)
nothing to commit, working tree clean
状态:已推送(git push)
git push,变为已推送状态,推送到远程仓库
push 指定服务器,提交远程分支
$ git push origin bthss_V3.0.4// 结构
Counting objects:6, done.
Delta compression using up to 4 threads.
Compressing objects:100%(4/4), done.
Writing objects:100%(6/6),474 bytes |474.00 KiB/s, done.
Total 6(delta 2), reused 2(delta 0)
remote:
remote: To create a merge request for bthss_V3.0.4, visit:
remote: http://git.cnsuning.com/bthss/bthss_git/merge_requests/new?merge_request%5Bsource_branch%5D=bthss_V3.0.4
remote:
To http://git.cnsuning.com/bthss/bthss_git.git
e0c7639..584fb03 bthss_V3.0.4-> bthss_V3.0.4
查看状态
$ git status
On branch bthss_V3.0.4
Your branch is up to date with 'origin/bthss_V3.0.4'.
nothing to commit, working tree clean