[Git] Remote Branch and Tag
Git and Remote TAG Branch
2023-09-14 08:59:21 时间
/** Remote branch and tags */ $ git checkout -b shopping_cart //switched to a new branch 'shopping_cart' and checkout(Locally) $ git push origin shopping_cart //Links local branch to the remote branch (remote tracking) $ git add cart.rb $ git commit -a -m "Add basic art ability" $ git push //Now, we put all the local stuff to the remote branch shopping_cart //If use: $ git branch * master /*You will not see the remote branch, By using:*/ $ git branch -r //list all remote branches origin/master origin/shopping_cart $ git checkout shopping_cart Switch to a new branch shopping_cart /*Remote show*/ $ git remote show origin /*Removing a branch*/ $ git push origin :shopping_cart //deletes remote branch, you still have local branch $ git branch -d shopping _cart //It might show the error: The branch 'shopping_cart' is not fully merged. //If you really want to delete it: $ git branch -D shopping_cart /*To clean up deleted remote branches*/ $ git remote prune origin //remove branch reference /*Remote branch names*/ //heroku-staging: only deploy on the master branch //if you do: $ git push heroku-staging staging Would not work, would push to staging $ git push heroku-staging staging:master Will push and deploy staging on keroku /** Tagging */ /*A tag is a reference to commit relase versioning*/ $ git tag v0.0.1 v0.0.2 $git checkout v0.0.1 checkout code at commit //To add a new tag $ git tag -a v0.0.3 -m "version 0.0.3" //To push new tags $ git push --tags //Retrive tag version $ git checkout v1.3.1 ------------------------------------------ 1. create a local branch hamsters $ git branch hamsters 2. check out the local branch $ git checkout -b hamsters 3. push local branch to the remote branch $ git push origin hamsters 4. "git branch -r" does not query the remotes to check for new branches. In order to see a new remote branch you first have to do a fetch or a pull. So retrieve the remote "weasel" branch $ git fetch 5. Get a list of remote branches $ git branch -r 6. delete the remote branch $ git push origin :weasel 7. Check for stale branches that are tracking "origin" $ git remote show origin 8. You still have a stale local branch tracking the now-deleted origin/weasel. Clean up your local references. $ git remote prune origin 9. List tag $ git tag 10. create new tag $ git tag -a v1.3.2 -m "Version1.3.2" 11. push tag $ git push --tags 12. The client is requesting that you roll back to the prior release. (Seriously? What could have gone wrong with the hamsters?) Retrieve the release tagged "v1.3.1". $ git checkout v1.3.1
13. git checkout tags/1.0.0 -b <new_branch_name>
相关文章
- git commit后,如何撤销commit
- origin安装嵌入python_python爬虫之git的使用(origin说明)
- git 那些事儿 —— 基于 Learn Git Branching
- Git Windows下载安装详细教程
- Git知识总览(一) 从 git clone 和 git status 谈起「建议收藏」
- error: failed to push some refs to ‘git@gitee.com:xxx/xxx.git’ 问题 解决办法
- git安装教程图文详解_git vim命令
- 如何自建一个git服务器,搭建Git服务器,真的很简单
- Git 服务端软件 Gitea 的 Windows 版安装笔记
- Git 源码泄露 && GitHack使用
- 【Git】Git 分支管理 ( 删除远程分支 | 查看远程分支 git branch -a | 删除远程分支 git push origin --delete feature1 )
- 【错误记录】Git 使用报错 ( git branch -a 仍能查询到已经删除的远程分支 )
- 【问题记录】ANOMALY: use of REX.w is meaningless (default operand size is 64)导致git命令无法使用
- git 常用操作详解程序员
- Git branch && Git checkout常见用法详解程序员
- Linux下Git强大的终端界面(linuxgit界面)
- MySQL中的OR与AND操作符比较(mysqlor和and)
- 快速启动Linux下的Git服务(linux启动git服务)
- git和春天、Linux和Git一起收获成功(springlinux)
- 极速学习:Linux下使用Git的基础知识(linux如何使用git)
- 安装Git服务器:在Linux环境下的步骤(linux安装git服务器)
- 在Linux上升级Git的必要性(gitlinux升级)
- Linux下使用Git的快速安装步骤(linux下git的安装)
- Linux下安装Git的指引(在linux下安装git)
- 深入探究Mysql中IN与AND逻辑运算的应用(mysql中in与and)
- MySQL中的AND逻辑操作符是什么(mysql中and是什么)
- and的区别Oracle数据库中的OR与AND的差异(oracle中or和)
- Oracle 数据库中使用AND拼接的威力(oracle中and拼接)