Linux Software - Git

git 命令

查看当前状态

1
git status

添加修改的文件到暂存区

1
git add .

将暂存区的文件提交

1
git commit

在上一次提交的基础上修改提交

1
git commit --amend

在上一次提交的基础上修改提交提交者

1
git commit --amend --author="xxxx@gmail.com"

查看当前branch

1
git branch

查看所有branch

1
git branch -a

查看当前branch 详细信息

1
git branch -vv

将现有修改cherry-pick 下来,并携带cherry-pick 信息

1
git cherry-pick -ex

下载指定分支的代码

1
git clone ssh:xxxxx -b branch

向指定分支提交代码

1
git push ssh:xxx HEAD:refs/for/master

将开发分支merrge到主分支

1
git merge --no-ff -m "Merge remote-tracking branch 'origin/master' into feature" origin/master

查看当前最近的TAG

1
git describe --match \"[0-9]*.[0-9]*.[AZ]*.[0-9]*.[0-9]*\" --abbrev=0

修改切换账户后不能上传问题

1
git config --global --unset credential.helper
0%