git branch --set-upstream-to origin/branchName // 将本地分支与远程分支关联 // 对远程分支的操作 git merge <remote-name>/<branch-name> // 把远程分支合并到当前分支 git checkout -b <branch-name> <remote-name>/<branch-name> // 在远程分支的基础上创建新的本地分支 git rebase <rebase-branc...
AI代码解释 #>git checkout--helpNAMEgit-checkout-Switch branches or restore working tree filesSYNOPSISgit checkout[-q][-f][-m][<branch>]git checkout[-q][-f][-m]--detach[<branch>]git checkout[-q][-f][-m][--detach]<commit>git checkout[-q][-f][-m][[-b|-B|--orphan]<n...
$ git status On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: .gitmodules new file: DbConnector 首先应当注意到新的 .gitmodules 文件。 该置文件保存了项目 URL 与已经拉取的本地目录之间的映...
-b <branch-name>, --initial-branch=<branch-name>:为新创建的版本库中的初始分支指定的名称。如果未指定,则使用默认名称(目前为master。可以通过init.defaultBranch变量自定义)。 --shared[=(false|true|umask|group|all|world|everybody|0xxx)]:指定Git版本库要在多个用户之间共享。如果指定了配置变量"core....
git checkout ${branch_name} 合并其他分支到当前分支 git merge ${other_branch} 删除本地分支 git branch -d ${branch_name} 强制删除本地分支 git branch -D ${branch_name} 删除远程分支 git push origin --delete ${branchname} 6、回滚 全部回退到指定版本 git reset –hard ${HEAD} 回退版本库信...
发现上游有多个分支,为了查看不同分支,学了 branch 和 checkout (现在一般用 switch)。因为上游用了...
On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: .gitmodules new file: DbConnector First you should notice the new.gitmodulesfile. This is a configuration file that stores the mapping betwe...
See also the --amend option to git-commit[1]. Undo a commit, making it a topic branch $ git branch topic/wip (1) $ git reset --hard HEAD~3 (2) $ git switch topic/wip (3) You have made some commits, but realize they were premature to be in the master branch. You want to...
git status--ignore-submodules 日志 # 查看完整历史提交记录 git log # 查看前N次提交记录 commit message git log-2 # 查看前N次提交记录,包括diff git log-p-2 # 搜索关键词 git log-SJava # 只显示合并日志 git log--merges # 以图形查看日志记录, --oneline 可选 ...
The first method involves renaming a local branch while you are currently on that branch. Here's a step-by-step breakdown: Check Your Current Branch:Before renaming a branch, verify that you are on the branch you want to rename by using thegit branchcommand. This command lists all existing...