branch

Does GitHub garbage collect dangling commits referenced in pull requests?

南楼画角 提交于 2019-12-21 03:28:06
问题 The following situation arises from time to time… I git checkout -b experiment , commit some experimental changes, and open a pull request. After some discussion, the pull request is rejected. If I were now to delete the remote branch, would this render the diff inaccessible at some point, or does GitHub ensure that commits which appear in pull requests are not garbage collected even if they don't appear on any branch? I would like to delete dead branches, but only if doing so will not

git-push(1) Manual Page

若如初见. 提交于 2019-12-21 01:32:46
git-push(1) Manual Page NAME git-push - Update remote refs along with associated objects SYNOPSIS git push [--all | --mirror | --tags] [--follow-tags] [-n | --dry-run] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [--prune] [-v | --verbose] [-u | --set-upstream] [<repository> [<refspec>…]] DESCRIPTION Updates remote refs using local refs, while sending objects necessary to complete the given refs. You can make interesting things happen to a repository every time you push into it, by setting up hooks there. See documentation for git-receive-pack(1) . When the command

git的一些操作

不想你离开。 提交于 2019-12-21 01:31:01
一、git常用命令 1. git remote -v 查看远程路径 2. git log --stat 显示最近修改了哪些文件 3. tag 打tag git tag -a tagname -m "commit" 推送tag到服务器 git push origin tagname 拿tag代码:需要branch,再该branch上拿代码 git checkout -b branchname tagname 删除tag 本地:git tag -d tagname 服务器:git push origin :tagname 在历史提交上打tag git tag -a SDK6.0ha.1.2.5_AAND_20140723 -m "xxxx" commit_id 更新tag git tag -f tagname git push origin tagname 4. branch 查看服务器branch git branch -r 删除branch git branch -d branchname 5. 比较单个文件两次提交的差异 git diff c62bfec9464f0813a0c0fc5b33c0c94360b6f97b 2cf3132a1924a8bff2fcf695e968bca44468f02c AndroidManifest.xml 6. git show tag

管理分支:git branch

五迷三道 提交于 2019-12-21 01:25:55
新建分支的意义: 创建一个单独的工作分支,避免对主分支master造成太多的干扰,也方便与他们交流协作。 进行高风险的工作时,创建一个实验性的分支,扔掉一个烂摊子总比收拾一个烂摊子好得多。 合并别人工作的时候,创建一个临时分支,用临时分支合并别人的工作分支有技巧。 创建分支:  git branch 分支名 删除分支:  git branch -D 分支名 查看分支:  git branch 切换分支:  git checkout 分支名 查看当前分支的发展:  git whatchanged 查看两个分支的差异:  git diff 分支1 分支2 查看版本库中每个分至点呃世系发展:git show branch 合并两个分支:将分支1合并到分支2.     先切换到分支2:git checkout 分支2     把分支1合到分支2:git merge “Merge work in 分支2” HEAD 分支2             或               git pull . 分支2 合并分支时肯定会有冲突,手动解决冲突即可。 逆转与恢复:git reset 使用格式:git reset [--mixed | --soft | --hard] [<commit-ish>] 命令选项:   --mixed:仅是重置索引的位置,而不改变工作树中的任何东西(即

Using git-svn to merge a svn branch back into trunk and trunk back into the branch

微笑、不失礼 提交于 2019-12-20 20:31:34
问题 So I'm using git and interacting with an svn repo. I have a svn TRUNK that looks like this: A-B-C-D And a svn bug_fixes branch that branches off at commit B or C: -c-d-e-f-g-h-i Now I need to get the cdefghi commits that are in my svn branch back into the master branch. I'm aware that I could just do a squashed commit, let's call it squash SQUASH (which would contain cdefghi), but then it seems like I would have to kill the bug_fixes branch and start a new branch to cleanly continue. Here:

Using git-svn to merge a svn branch back into trunk and trunk back into the branch

这一生的挚爱 提交于 2019-12-20 20:31:03
问题 So I'm using git and interacting with an svn repo. I have a svn TRUNK that looks like this: A-B-C-D And a svn bug_fixes branch that branches off at commit B or C: -c-d-e-f-g-h-i Now I need to get the cdefghi commits that are in my svn branch back into the master branch. I'm aware that I could just do a squashed commit, let's call it squash SQUASH (which would contain cdefghi), but then it seems like I would have to kill the bug_fixes branch and start a new branch to cleanly continue. Here:

Git的使用

人盡茶涼 提交于 2019-12-20 19:52:38
分支介绍 master :这个分支的代码是发布到生产的代码 develop :这个分支的代码是预发布到生产的代码 release :这个分支的代码是新版本发布到生产的代码 feature :这个分支的代码是新需求开发的代码 hotfix :这个分支的代码是紧急修复生产 bug 的代码 分支切换 查看本地分支 > git branch * master 查看所有远程分支 > git branch -a * master remotes/origin/HEAD - > origin/master remotes/origin/coraline remotes/origin/developer remotes/origin/feature/ remotes/origin/master 切换分支 > git checkout -b dev origin/developer Switched to a new branch 'dev' Branch 'dev' set up to track remote branch 'developer' from 'origin' . > git branch * dev master 查看本地分支和远程分支的关联 > git branch -vv * dev ****** [ origin/developer ] code master ******

Mercurial Undo Merge

纵然是瞬间 提交于 2019-12-20 18:03:12
问题 Have a scenario where we un-intentionally merged a named branch ( ABC ) into our default branch. hg rollback is not an option because there have been a couple commits since. Is there a way to undo this? 回答1: If you haven't publish the repo publicly you can do this hg clone -r (parent1 of bad merge) -r (parent2 of bad merge) old new and delete the old repo. 回答2: You're going to need the Mq extension. If you don't have it turned on, do so by adding this to your Mercurial.ini or .hgrc file.

Git: merge only the changes made on the branch

自闭症网瘾萝莉.ら 提交于 2019-12-20 17:28:29
问题 G---H // Release Branch / / A---B---E---F--- // master \ \ C---D--- // bug fix branch Based on our particular needs for our project, it is quite common for the above scenario to occur. We have our master/dev branch with some commits. Then we get a bug report and start fixing that on the bug branch (commits C and D above). More commits happen in the dev branch in the meantime. Next we are told we need to create a release for a customer which cannot include the changes introduced by commits B,

Git - separate folder for each branch. Setting it up

雨燕双飞 提交于 2019-12-20 10:39:50
问题 I have a need to keep 3 branches in 3 separate folders. (I know this is not a git way of doing things. But I need to do this for a reason). Lets say the repo name is my_proj_repo.git I have created a folder called prodv1 in my local system: git clone url:/my_proj_repo.git Now I went into prodv1 folder and copied the files from a server, then: git commit -am "initial import" git push origin master That pushed the files to master. Now I created two more folders like the above in my local system