19. 从远程仓库拉取最新代码:git pull [remote] [branch] 20. 推送本地代码到远程仓库:git push [remote] [branch] 21. 创建标签:git tag [tag] 22. 切换到指定标签:git checkout [tag] 23. 删除标签:git tag -d [tag] 24. 查看分支合并图:git log –graph 25. 查看帮助文档:git help [command]...
git push 将当前分支推送到远程对应的分支(若远程无对应分支,则推送无效) git push origin dev 将分支dev提交到远程origin/dev(远程没有则创建, 远程没有dev则创建) git branch –set-upstream branch-name origin/branch-name 建立本地分支和远程分支的关联 git checkout -b dev origin/dev 创建远程的origin/d...
fetch Download objects and refs from another repository pull Fetch from and integrate with another repository or a local branch push Update remote refs along with associated objects 'git help -a' and 'git help -g' list available subcommands and some concept guides. See 'git help <command>' ...
1. 命令行界面(Command Line Interface,CLI):使用命令行工具(如Git Bash、Terminal等)直接输入Git命令,按下回车键执行。 2. Git GUI工具:使用图形界面的Git客户端工具,通过界面中的按钮、菜单等操作来执行Git命令。 3. 集成开发环境(Integrated Development Environment,IDE):使用支持Git插件的IDE工具,通过界面操作执...
git branch --set-upstream dev origin/dev 有时候,我们需要删除没有 untracked 的文件,可以通过下面这个命令完成: #删除没有untracked的文件 git clean -d -xf 3.7、冲突处理 版本同步的时候,如果大家都修改了同一个文件,难免会发生冲突。 比如,当修改的文件未提交,直接远程拉取代码会发生冲突,改怎么办呢?
$ git branch-a <-m ,--move | -M> 移动/重命名一个分支和相应的历史信息 # <-M>:强制move/rename$ git branch-m bug-fixedbug-fixed2 <-d, --delete | -D> 删除本地分支,不能删除当前checkout的分支; 如果要删除的分支有未合并的内容,则会报错:'the branch XXX is not fully merged',解决办...
git push origin master/branch : 把分支master/branch 上修改推送到远端,第一次的时候加上 -u 参数,建立本地分支和远程分支之间的关系 git checkout file : 从远端上拿到file 文件覆盖工作区的file,会丢失工作区该文件的修改 git diffgit diff HEAD --file:比较工作区和暂存区里文件的变化 ...
git branch --merged main | grep -v "^\* main" | xargs -n 1 -r git branch -d See the list of local git branches that remain Copy git branch Deleting Local Branches That No Longer Exist on the Remote Open git bash and navigate to your git repository that you want to clean up ...
git branch a //创建一个分支a git checkout a //切换到分支a git merge a //先切换到master线,再合并a分支,或者切换到a分支合并master ``` 三.删除远程仓库的文件夹 ``` git rm -r --cached some-directory git commit -m "Remove the now ignored directory some-directory ...
打开~/.bash_profile,添加对PROMPT_COMMAND的配置 exportPROMPT_COMMAND='echo -ne "\033]0;$PWD\007"' 效果: iTerm2 快捷命令 命令 说明 command + t 新建标签 command + w 关闭标签 command + 数字 / command + 左右方向键 切换标签 command + enter 切换全屏 command + f 查找 command + d 垂直分屏...