branch

How to close a branch WITHOUT removing it from history in git?

蹲街弑〆低调 提交于 2019-12-20 08:02:34
问题 I'd like to make a commit and close its branch, without removing it from history . With mercurial I'd commit --close-branch , then update to a previous one, and go on working. With git... I'm confused. 回答1: There's no exact equivalent to closing a branch in Git, because Git branches are more lightweight than in Mercurial. Their Mercurial equivalent is more bookmarks than branches. If I understand correctly, closing a branch in Mercurial roughly makes it disappear from the branch list, so you

Git branch deletion

为君一笑 提交于 2019-12-20 07:58:31
问题 In Git, what does "deletion" of a branch mean? Will it be gone from the repository? Or will it still be navigable to via git branch ? What I really want to do is mark a branch as "dead end", i.e., the branch is so far from master, that nobody should use it as a starting point, though there were some good ideas down that branch, so we'd like to keep it, for reference. 回答1: You can delete the branch, but tag it first, so that it's history doesn't disappear. This way, the branch doesn't show up

Why when I make a change in 'X' branch my master branch is changing as well in the same way?

给你一囗甜甜゛ 提交于 2019-12-20 07:16:45
问题 I have a master branch: Then I make employee branch from the master and change it a bit: And when I swipe between branches, the master branch also had been changed: I have no clue why it happens. Any suggestions how to return it back to norm? 回答1: When you make a change in your editor, you only modify the code in your "working directory". When you switch branches, those changes in your "dirty" directory come along for the ride. Once you commit your changes on a given branch, switching

Change Default branch for GITHUB using API.

霸气de小男生 提交于 2019-12-20 06:41:43
问题 I need to create a branch dev which is other than master branch. Also need to update dev to default branch using GITHUB API. Please share details if anyone know which API to call or a way to do it, programmatically. I understand with help of UI we can do it. Thanks Ashish 回答1: Following the guide here: https://developer.github.com/v3/repos/#edit , default_branch input should make what you want default_branch (string): Updates the default branch for this repository. So, you should submit a

Git: can't switch between branches

只谈情不闲聊 提交于 2019-12-20 06:28:12
问题 In a local folder with several files, I have a git repository for which branch x only includes a few of those files, and the master one includes them all. When I try to switch from x to master, I get: $ git checkout master error: The following untracked working tree files would be overwritten by checkout: [...some files...] Aborting EDIT: None of the listed files belong to branch x, they all belong to the master one. I'm pretty confident they haven't been modified and in any case I am ok with

Separate git branch into multiple branches to merge to master

余生长醉 提交于 2019-12-20 03:33:06
问题 My team has been working in a prototype branch off of master. I now want to take that work, slice it up into different "feature branches", and merge them individually into master. I see a couple ways to do this, neither of which I really like: 1 - Create a new branch, Feature_1, off of master . Manually copy the code from the Prototype to Feature_1. This means I have to keep track of what I've copied when I go to make Feature_N and I lose history. 2 - Create a new branch, Feature_1, off of

【Git push】官网文档(tortoiseGit)翻译【及一次实践】

怎甘沉沦 提交于 2019-12-20 03:31:33
1、实战,tortoiseGit配置不对会出问题:提示 sh variable simple not … =================================================================== 本文是对tortoiseGit的help文档 (2.8. Push)做翻译,纯属好玩。 2.8. Push(推送) This section talks about how to push (i.e., send) changes to another repository. 本节讨论怎样推送(或者发送)变更到其他仓库。 In order to perform a push open the push dialog using TortoiseGit → Push… . Pushing changes is also possible using the Sync dialog (cf. Section 2.9, “Sync”), however, there you have less options, but the sync dialog allows you to initiate other operations such as pulling and to see diffs and changes. 为了执行推送我们需要首先通过

mysterious vanishing branches in git

蹲街弑〆低调 提交于 2019-12-20 02:42:26
问题 Here are some git actions I performed. As you can see, I made a new branch, modified my files, and then committed the changes. After changing back to another branch, hoping to merge, the branch I was just working on disappeared. Does anyone know how I can recover the files from fixed_merge_branch? I'm freaking out! 1.9.2@whisperme$ git branch fixed_merge_conflict 1.9.2@whisperme$ git checkout fixed_merge_conflict M ArtworkViewController.h M ArtworkViewController.m M ArtworkViewController.xib

Workflow to “backport” change into different Mercurial (Hg) branch?

故事扮演 提交于 2019-12-19 13:56:22
问题 We have two heads. One is our main development head and the other is one that I forgot about until today. We found a bug and fixed it in our main development branch, and I just realized it should be fixed in the older branch as well. I think it would have been better to make the change on the older branch and merge that with the up-to-date branch, but we didn't do it that way. Can mercurial handle this? We haven't tried to do anything like this and I can't really wrap my head around how it

Does TFS branching have a child parent relation?

余生长醉 提交于 2019-12-19 10:52:44
问题 When doing branches in tfs, does it matter if you are branching A to B or from B to A? The thing is that we have branch A and branch B, and now branch A has got messed up and we would like to recreate it from branch B by branching a new branch from B. As far as I know when you do a branch you get a relationship between the branches, but you don't get a "parent-child" relation, is that correct? Is my question clear? 回答1: At the point where a new branch is constructed, it gets equal to what you