branch

Git 'fatal: No such ref: HEAD'

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: A weird thing happend to my git repository. When I try to commit something in tortoisegit window I receive all files from project. I cannot revert them, when I pull from server I receive fatal: No such ref: HEAD and fatal: Cannot lock the ref 'HEAD' . All my local branches are missing. Is there any way to resolve the problem? This is not first commit or something. This thing happend suddenly. EDIT: git branch -a says: Failed to resolve HEAD as a valid ref git status prints all project files marked as new file. I changed repository folder

What are the benefits of Mercurial or git over svn for branching/merging?

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've heard for instance that merging branches with git or mercurial is easier than with svn. Reading last Joel on software blog entry, I didn't get it exactly why. Could you provide a concrete example where merging with git/mercurial lead to less merge conflicts compared to svn please? 回答1: One simple example is git can automatically convert a merge into a "fast forward". For example, let's say I have a branch that looks like this: Master: A ---> B ---> C And I create a feature branch based on Master with new commits D and E. Feature: A ---

ORIG_HEAD, FETCH_HEAD, MERGE_HEAD etc

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: There's a lot of useful git references (what is the exact name for this?), e.g. HEAD , ORIG_HEAD , FETCH_HEAD , MERGE_HEAD , @{upstream} etc. Is there any reference for this? A complete list with explanations? 回答1: git help revisions brings up http://git-scm.com/docs/gitrevisions , which describes all the the most common ways to reference commits: HEAD names the commit on which you based the changes in the working tree. FETCH_HEAD records the branch which you fetched from a remote repository with your last git fetch invocation. ORIG_HEAD is

Git push won't do anything (Everything up-to-date)

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to update a git repository on github. I made a bunch of changes, added them, committed then attempted to do a git push. The response tells me that everything is up to date, but clearly it's not. git remote show origin responds with the repository I'd expect. Why is git telling me the repository is up to date when there are local commits that aren't visible on the repository? [searchgraph] git status # On branch develop # Untracked files: # (use "git add <file>..." to include in what will be committed) # # Capfile # config/deploy

Git rebase fails, &#039;Your local changes to the following files would be overwritten by merge&#039;. No local changes?

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Here is my transcript from trying to merge my bugfix branch onto my master branch in preparation to push it upstream. There have been some upstream changes pulled into master since the bugfix branch was created, and it now refuses to rebase. The files it throws errors on are not diffed when opened. no files have been added, removed or renamed. Nothing is ignored and nothing is untracked or staged or unstaged. I'm completely stumped as to why the rebase is failing. I'm on OS X 10.6.6 and git 1.7.4 .-(/Volumes/joshua/www/txfunds)--------------

git: diff between file in local repo and origin

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to find the differences between a file I have in my local repo vs what is in the origin master. I know that there is git diff, however I just want to isolate it down to this one particular file. For simplicity lets say the files is named file1.txt and it has a local file path = [local_path] and in the origin it has filepath = [remote-path]. What would be the git command I need to type? EDIT: Thank you all for your input it has been very insightful. For those that are using Eclipse (which I am and I should have stated earlier) I just

Your branch is ahead of &#039;origin/master&#039; by 3 commits

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am getting the following when running git status Your branch is ahead of 'origin/master' by 3 commits. I have read on some other post the way to fix this is run git pull --rebase but what exactly is rebase, will I lose data or is this simple way to sync with master? 回答1: You get that message because you made changes in your local master and you didn't push them to remote. You have several ways to "solve" it and it normally depends on how your workflow looks like: In a good workflow your remote copy of master should be the good one while

Git: Merge a Commit into a different Branch

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So I have 3 branches; develop - my continued development branch version_1 - a release branch version_2 - a release branch I had to do a hotfix on version_2 to reship that version, it was a 2 line change in 2 files, very small. I wanted to apply that fix to version_1 and develop . So I; git checkout version_1 git merge <commit checksum> I thought a commit only contains the changes, so would only apply those. But the merge conflicts because it tries to update all the changes between the two branches. Is there a way to merge/move/apply ONLY the

Deleting remote master branch, refused due to being current branch

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: How do I delete a remote master branch from GitHub/Bitbucket? I'm trying: # git push bb --delete master remote : bb / acl : user is allowed . accepted payload .[ K remote : error : refusing to delete the current branch : refs / heads / master [ K To ssh : //git@bitbucket.org/user/reponame.git ! [ remote rejected ] master ( deletion of the current branch prohibited ) error : failed to push some refs to 'ssh://git@bitbucket.org/user/reponame.git' Also I tried git push bb : master But all this is not work. 回答1: Note: for BitBucket ,

Reintegrate can only be used if revisions X through Y were previously merged from &lt;URL&gt; to reintegrate the source, but this is not the case

匿名 (未验证) 提交于 2019-12-03 02:12:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Been using SVN branches with Tortoise 1.6. I've been periodically merging the trunk into the branch to keep it up to date. Today, I thought I'd reintegrate the branch. I chose "Reintegrate a branch" from Tortoise and received the following error message: Reintegrate can only be used if revisions 4709 through 5019 were previously merged from http://subversion/svn/saxdev/trunk to the reintegrate source, but this is not the case It then listed around 50 files with descriptions such as this: Error: branches/qst/kobalt/sax/businessobjects/util