branch

Git-flow and master with multiple parallel release-branches

匿名 (未验证) 提交于 2019-12-03 02:12:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We are trying to adopt the successful Git branching model implemented by git-flow. Now, we are working on at least two release-branches, one for the latest stable release and one for the next ("preview") release. What I don't understand is why all releases seems to "linearized" to the master and tagged there. Why not tag the releases in their release branches? Why the master at all? Or why a develop branch and not use master for it? 回答1: In the git-flow model, your "latest released" version actually maps to the master , while your "preview

Git-flow and master with multiple parallel release-branches

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We are trying to adopt the successful Git branching model implemented by git-flow. Now, we are working on at least two release-branches, one for the latest stable release and one for the next ("preview") release. What I don't understand is why all releases seems to "linearized" to the master and tagged there. Why not tag the releases in their release branches? Why the master at all? Or why a develop branch and not use master for it? 回答1: In the git-flow model, your "latest released" version actually maps to the master , while your "preview

git: updates were rejected because the remote contains work that you do not have locally

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm working on a team with a few developers using git on BitBucket. We are all working on a dev branch, not pushing to master until a release. One of the developers committed incorrect code that overwrote my own by accident, and now I am trying to push the correct code back to the repo. I have been reading on this error for a few days now, I can't push to the repo anymore because I am getting the following error: ! [rejected] master -> dev (fetch first) error: failed to push some refs to 'https://myusername@bitbucket.org/repo_user/repo_name

git log and show on a bare repo

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I created a bare repository on a file-server in my local network at home. After this i pushed a branch of an existing repository from my desktop-pc to this new remote repository. Pushing worked perfectly and it seems, that all data arrived (a "git branch -va" gives me the correct data). But i cannot use git log or git show on the bare repository. i get an: fatal: bad default revision 'HEAD' or simply no output is this normal for bare repositories? Is there another possibility to visualize everything? Edit: The fatal error is solved

How to merge a specific commit in Git

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have forked a branch from a repository in GitHub and committed something specific to me. Now I found the original repository had a good feature which was at HEAD . I want to merge it only without previous commits. What I should do? I have known how to merge all commits: git branch -b a-good-feature git pull repository master git checkout master git merge a-good-feature git commit -a git push 回答1: ' git cherry-pick ' should be your answer here. Apply the change introduced by an existing commit. Do not forget to read bdonlan 's answer about

GIT: How can I prevent foxtrot merges in my 'master' branch?

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: A foxtrot merge is a merge where 'origin/master' merges in as a 2nd (or later) parent, like so: Commit 'D' is a foxtrot merge because 'origin/master' is its 2nd parent. Notice how first-parent history from 'origin/master' contains commit 'B' at this moment. But in my git repo I need all merges involving 'origin/master' to keep 'origin/master' as the 1st parent. Unfortunately git doesn't care about parent-order when it evaluates whether a commit is eligible for fast-forward. This causes the first parent history on my master branch to

Find out which remote branch a local branch is tracking

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 选择语言 中文(简体) 日语 英语 中文(繁体) 由 翻译 强力驱动 问题: See also: how do I get git to show me which branches are tracking what? How can I find out which remote branch a local branch is tracking? Do I need to parse git config output, or is there a command that would do this for me? 回答1: Here is a command that gives you the tracking branch: $ git branch - vv main aaf02f0 [ main / master : ahead 25 ] Some other commit * master add0a03 [ jdsumsion / master ] Some commit You have to wade through the SHA and any long-wrapping commit messages, but it's quick to type

What is HEAD in Git?

匿名 (未验证) 提交于 2019-12-03 02:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: You see the Git documentation saying things like The branch must be fully merged in HEAD. But what is Git HEAD exactly? 回答1: You can think of the HEAD as the "current branch". When you switch branches with git checkout , the HEAD revision changes to point to the tip of the new branch. You can see what HEAD points to by doing: cat .git/HEAD In my case, the output is: $ cat .git/HEAD ref: refs/heads/master It is possible for HEAD to refer to a specific revision that is not associated with a branch name. This situation is called a detached HEAD

When do you use git rebase instead of git merge?

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When is it recommended to use git rebase vs. git merge ? Do I still need to merge after a successful rebase? 回答1: Short Version Merge takes all the changes in one branch and merges them into another branch in one commit. Rebase says I want the point at which I branched to move to a new starting point So when do you use either one? Merge Let's say you have created a branch for the purpose of developing a single feature. When you want to bring those changes back to master, you probably want merge (you don't care about maintaining all of the

git: Switch branch and ignore any changes without committing

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I was working on a git branch and was ready to commit my changes, so I made a commit with a useful commit message. I then absentmindedly made minor changes to the code that are not worth keeping. I now want to change branches, but git gives me, error: You have local changes to "X"; cannot switch branches. I thought that I could change branches without committing. If so, how can I set this up? If not, how do I get out of this problem? I want to ignore the minor changes without committing and just change branches. 回答1: You need a clean state