branch

Recover unreferenced commits from remote git repository

做~自己de王妃 提交于 2019-12-10 13:23:31
问题 Here's the situation : some commits have been done in a remote repository. Unfortunately, someone did push -f such that no remote branch references these commits anymore. To make matters worse, I don't have those commits in my local clone. My goal is basically to recover those commits. These are some of the things I tried : git checkout -b recovery <commit_id> : fatal: reference is not a tree git push origin <commit_id>:recovery error: refs/heads/recovery does not point to a valid object!

Switch node_modules folder when I change git branch

北城以北 提交于 2019-12-10 12:53:20
问题 I'm working with two branches, master and feature-1 In the master branch I'm using a lib xyz@1.0 In the branch feature-1 I've installed a new version from lib xyz version 2.0 feature-1 was not merged yet on master branch, because it's not done. Then when I switch to master again I've to re-install the lib@1.0 , and if I switch again to feature-1 I've to re-install the lib@2.0 What's the best workflow approach in theses cases? 回答1: You do things well with git and each time you switch, you have

How to only merge changes added after a certain revision (both ways)?

寵の児 提交于 2019-12-10 12:36:12
问题 Can git merge mostly ignore some file deletions and file renames between two branches, while merging only subsequent changes to the files that were renamed (and ignoring changes to the files that were deleted in one branch), back and forth between the two branches? Thus, I would like to be able to merge changes both ways between two branches. The development branch is initially a copy of the master branch, but with numerous deletions and file renames. This last point is what breaks the method

TFS Branch/Merge meets History View

浪尽此生 提交于 2019-12-10 12:31:48
问题 We have a setup with a development "trunk" in our recently-migrated-to-from-VSS TFS system and developers have been doing work in branches off the trunk, which are merged back in. We've been diligently commenting our changesets at check in time, something we never did in the VSS days. However when I right-click on a trunk file in the Source Control Explorer and choose History, I only see monolithic changesets labeled "merge from dev branch" (or whatever the developer scribbled in there when

TeamCity show branch in artifact zip name

巧了我就是萌 提交于 2019-12-10 11:10:31
问题 I have a build in TeamCity where I want to build an artifact zip file. I can use Edit Configuration Settings => General Settings => Artifact Paths to set up the files to zip and the zip file name. I want to make the name more descriptive, and TeamCity lets me use parameters, e.g. : out/mypackagedfiles/** => MyBuild_%build.number%.zip will give me a zip file like MyBuild_46.zip . I'd also like to include the branch that the build was built from. This is also available as a TeamCity parameter,

ClearCase: How do I know the parent branch of a branch?

谁都会走 提交于 2019-12-10 10:28:21
问题 Is that possible to get hierarchy of branches? I have to know the father of a given branch I have to know the children of a given branch How do I get it by cleartool? I prefer not to be based on a view config-spec Thank you! 回答1: With base ClearCase, you cannot know the parent of a branch, because it can vary from file to file: a file can start branch ' B2 ' from ' /main/LATEST ', another can start the same branch from ' /main/B1/LATEST '. For ClearCase UCM, you can determine the parent of a

Keeping a public and private version of my app using Git

谁说我不能喝 提交于 2019-12-10 09:23:43
问题 I am building a Rails app that I manage with Git. All is perfect, but I'd like keep a public version as well as a private one. That is: the public version is for a public repository (for people to use), and the private version is for my own site. The idea is that both versions should be up-to-date, with the difference that my private version's files contain passwords for my site, and the public version doesn't (or contains some default values as such). I've been thinking of branches: master

What are the differences between GIT and SVN when it comes to merge conflicts solving

可紊 提交于 2019-12-10 06:06:09
问题 I keep hearing that branching in git is so much easier than in SVN, because it's easier to merge the branch back to trunk/master. I've read some tutorials, but they only covered basic merge conflicts ("Alice changed line 8 of code.cpp and at the same time Bob changed line 8 of code.cpp...") and there are no differences between SVN and all other distributed source control systems. Can you give me the examples of changes in branch that would cause troubles in SVN repository, but would be

git filter-branch duplicated commits

霸气de小男生 提交于 2019-12-10 05:33:42
问题 I was rewriting my git repository's author history like explained here, however my original structure turned from D (user 2) <-- master | C (user 2) E (user 1) <-- branch 1 | | +-------------------------+ | B (user 1) | A (user 1) into D (user 1) <-- master G (user 2, original/refs/heads/master) | | C (user 1) F (user 2) E (user 1) <-- branch 1 | | | +-------------------------+-------------------------+ | B (user 1) | A (user 1) So the question is, how can I get rid of F and G altogether?

Where am I? * (no branch)

吃可爱长大的小学妹 提交于 2019-12-10 05:18:34
问题 I've been getting familiar with creating, merging and deleting branches. I like to know where I am so I don't commit work into the wrong branch. I use git branch -a to see which branches I have. I think the asterix * shows which branch I'm currently on. What does it mean when I get: * (no branch) master origin/HEAD Because when I $git checkout mybranch I expect to see * mybranch master origin/HEAD 回答1: The git checkout man page does mention, for the branch name argument: <branch> Branch to