git-branch

Best practices on GitHub repos, to Fork or create a New Branch

China☆狼群 提交于 2019-12-09 08:54:49
问题 I'm looking for the best practice, forking vs branching on GitHub. I've read this Forking vs. Branching in GitHub, but it's not relevant. Our team of 5 people are working on the same repository, and we would like to avoid merging problems, conflicts or regression in the code. The goal is for the 5 persons to work on different parts of the project, often on the same file. I would like to know if it's worth it to : fork the project, work and create pull requests, so each persons can review the

git track branch with different name

拜拜、爱过 提交于 2019-12-09 08:30:15
问题 I have a repo which tracks non-default branches. So, there is a local branch named "master" which should track "origin/master-13.07". I've done "push -u", and I believe it should be enough, the branch is tracked. Output of the git branch -vv : C:\work\repo>git branch -vv stuff 68792df [origin/stuff-13.07] Small bugfix * master 68792df [origin/master-13.07: ahead 1] Small bugfix Output of the git status C:\work\repo>git status # On branch master # Your branch is ahead of 'origin/master-13.07'

How to share a git feature (or topic) branch with multiple developers

♀尐吖头ヾ 提交于 2019-12-08 23:29:16
问题 I'm following the the workflow described here, as I found many references pointing to this page as a good workflow. As mentioned in the article, "feature" branches are shared between developers, but do not go to the central repository. Let's say a developer "A" starts a new feature branch with git checkout -b newfeature develop . Now let's say that developer "B" needs also to work on this feature. This is my problem. What I did: developer "B" adds developer A's machine as a remote developer

Critical situation in removing a local branch

喜夏-厌秋 提交于 2019-12-08 19:28:48
问题 I using the following command to remove a local branch with force delete option: $ git branch -D <branch_name> My question is, If I delete a local branch that had an upstream set and then do a normal push, it won't delete the remote branch right? What should I do in this situation? [ NOTE ]: "-D" is force delete option. I want delete the local branch and keep the remote branch in origin. 回答1: git will only delete your local branch, please keep in mind that local and remote branches actually

Difference between creating a branch and doing a soft reset? Best way to go back to an old working version?

巧了我就是萌 提交于 2019-12-08 19:10:45
Say the history of my commits is A - B - C and I have only this branch. B was fully working. I started adding some functionality in C, but it's not working so I need to go back to B, but I also want to retain the code I wrote in C because I will want to review it and fix it later. What is the best way to do it? Is the best way to create a new branch starting from B? What is the difference between that and doing a soft reset? I understand a soft reset doesn't delete the changes (is that correct?) but it's not clear to me how to restore those changes (the code in C), nor what the difference

List all local git branches without an asterisk [duplicate]

别等时光非礼了梦想. 提交于 2019-12-08 16:08:55
问题 This question already has answers here : How to iterate through all git branches using bash script (13 answers) Closed last year . If I run git branch , I get something like: * master dev foo if I do git branch -r , it will show all branches on the remote, without an asterisk (where the asterisk shows my current checked-out branch). How can I list all the local branches, without an asterisk showing up? I need a programmatic solution so I can read in the results line-by-line. 回答1: You can use

Why does `git checkout <branch> <file>` stage the change?

蓝咒 提交于 2019-12-08 15:26:53
问题 If I start from a clean working tree and run git checkout <branch> <file> , where <branch> has a different version of this file, I end up with a staged rather than an unstaged change. What's the reason for this? Is this just for consistency with other commands like git mv , which you would expect to stage changes? Is it for convenience when using git checkout to resolve merge conflicts? Or is there some other rationale? It seems mildly odd to me since just using git checkout <branch> <file>

Why do I see a deleted remote branch?

会有一股神秘感。 提交于 2019-12-08 15:04:24
问题 I have a remote repository and 2 clones. I create a branch in one of the clones e.g. test . I do some work and 2 commits. I merge to master branch and push -u the branch. I do a git pull in the other clone. I see both master and test . In the first clone project I do: git origin :test to delete test branch on remote repository. test is deleted on remote repos. I do git branch -D test and the test branch is deleted locally as well. If I do git branch -a I get: *master remotes/origin/master Now

Multiple streams over single project in Git?

蹲街弑〆低调 提交于 2019-12-08 14:59:27
I went through blog regarding Git best practices model . As we are going to make Git as our major head for SCM for the upcoming projects in our organization, I have some doubts, regarding them not able to find much over internet. Our project architecture is: We have only one Main-Project and in this project we have 8-10 sub-projects say SP1, SP2 ... SP8. All these projects are owned by their individual group members and they have nothing to do with any other Sub-Project. We also want to have one Master Branch one Testing branch and one Release Branch for our Main-Project. First: If we follow

Git push local master to remote specific branch [duplicate]

落爺英雄遲暮 提交于 2019-12-08 09:08:38
This question already has answers here : Push local master commits to remote branch (2 answers) Closed 2 years ago . I did changes in my local branch. Then I checkout to my master branch and merge it with my local branch. Now I want to push the changes in the master branch to specific branch at the remote. Say, we are 5 Developers. Each one having their own branch at remote repo. If I modified something at my local repo, I should push my work on the branch which is named in my name. How can I push that changes from my local repo master to my branch at remote repo? Once I pushed it to my branch