branch

How can I start a clean branch with no ancestry, then commit files progressively?

人盡茶涼 提交于 2019-11-29 20:15:49
I have a PHP framework versioned with GIT and I'm planning several (drastic) changes to its core. What I want to do is to start working on the new core in a new branch, but since this change might require some restructuring on the filesystem too, I'd like to start this new branch as cleanly as possible. I want the clean branch to include only with the core files. As I'm finishing my changes, I want to add the rest of the modules from the framework to the working directory one by one, but keep the ability to merge if I do changes on master. How can I do that? Branch with No Ancestors You want

Ambiguous Names with GIT?

拟墨画扇 提交于 2019-11-29 20:13:10
问题 I'm trying to check out one of my local branches, named TEAM20-lab2-release. When I try to do this, I get an ambiguous refname error: $ git branch TEAM20-lab2-release warning: refname 'TEAM20-lab1-release' is ambiguous. fatal: Ambiguous object name: 'TEAM20-lab1-release'. Here is the list of my branches: $ git branch -a TEAM20-lab1 * TEAM20-lab1-release master remotes/origin/HEAD -> origin/master remotes/origin/master 回答1: It usually is because you have the same name (than your branch) used

Push branches to Git

北城余情 提交于 2019-11-29 20:08:58
I have a local repository I'm working on and its remote is hosted on GitHub. I recently created a branch and started working on it, making several commits and now wish to push the branch to GitHub and be able to pull it to another cloned repository. What needs to be done to accomplish this? If this is not possible using GitHub, I'd be happy to know how to do it normally. git push origin <local-branch-name>:<remote-branch-name> Substitute for <local-branch-name> and <remote-branch-name> . They may be same or different, as you wish. J-16 SDiZ As you have set up the remotes already, the command

Which way to merge with git?

♀尐吖头ヾ 提交于 2019-11-29 20:00:59
问题 Say I have two branches master -- A - - - - - - merge \ / \- develop -- B -- C Now if I want to merge it will be a fast forward, but should I do git checkout develop git merge master or git checkout master git merge develop And what if I have possible conflicts master -- A - D - - - - - -merge \ / \- develop -- B -- C Should I now merge in to develop or into master? This is a bit confusing, so a good explanation would be really appreciated 回答1: Missing Workflow Tasks First of all, there are a

Git pull into wrong branch

核能气质少年 提交于 2019-11-29 19:48:06
Myself and one other developer had been merging and pushing our work to a non-master branch called toolwork. That way, we didn't impact the rest of the team. My topic branch was called DPM-93 and my git workflow was this. # do some work git checkout DPM-93 git commit -m "did some work" # catch up git checkout toolwork git pull origin toolwork # rebase my topic branch git checkout DPM-93 git rebase toolwork # merge and push my changes git checkout toolwork git merge --no-ff DPM-93 git push origin toolwork That was mostly working fine until I accidently issued these git commands git checkout

How to properly use git and branches

时光怂恿深爱的人放手 提交于 2019-11-29 19:45:09
I'm kind of new to version control with GIT. I read this Guide and am following the basic approach that is shown in the diagram HERE . Still, I have some doubts about how to use git branches to separate the development of new features from existing code. Here is an example. Suppose that at the start, my repository contains the following two main branches: Master branch (containing the release version) Develop Branch (containing new fixes or features to separate them from existing project features) When I need to develop new features or modules, I create branches from Develop and start the new

git rebase master then push origin branch results in non-fast-forward error

[亡魂溺海] 提交于 2019-11-29 19:25:41
问题 I am trying on working on my featureA branch while keeping it up-to-date with the master branch. Here is the scenario git clone ssh://xxx/repo git checkout -b featureA $ git add file.txt $ git commit -m 'adding file' $ git push origin featureA meanwhile a couple new commits where pushed to origin master git checkout master git pull origin master git checkout featureA git rebase master git push origin feature A To ssh://xxx/repo ! [rejected] featureA -> featureA (non-fast-forward) error:

How can I copy the content of a branch to a new local branch?

 ̄綄美尐妖づ 提交于 2019-11-29 19:03:05
I have worked on a local branch and also pushed the changes to remote. I want to revert the changes on that branch and do something else on it, but I don't want to lose the work completely. I was thinking of something like create a new branch locally and copy the old branch there, then I can revert the changes and continue working on the old branch. Is there a better way maybe? Or how do I do this? git checkout old_branch git branch new_branch This will give you a new branch "new_branch" with the same state as "old_branch". This command can be combined to the following: git checkout -b new

Take all my changes on the current branch and move them to a new branch in Git

早过忘川 提交于 2019-11-29 19:00:21
I started work on what I thought would be a minor bug fix on my master branch. However, it has spiraled out of control to the point where I wish I had created a separate branch to do the development in the first place. So right now what I'd like to do is: Create a new branch called (say) "edge" Move all the changed / untracked files on master to edge (such that master is unchanged from when I started the bug fix) Finish my work on edge, merge back into master How can I do this? If you haven't been committing anything yet, you're already in the right position. Create a new branch: git checkout

Correct Git workflow for shared feature branch?

﹥>﹥吖頭↗ 提交于 2019-11-29 19:00:02
I am trying to figure out the right workflow for this situation: On the shared repo, we have these branches: -master -feature The feature branch is a shared branch, since many developers are working on a new feature together. They are actively pushing their changes to the feature branch. I'm trying to avoid 'conflict hell' for the day that feature finally gets merged back into master . Currently, I see some options: 1) Actively merge master into feature , and do it often. However, this is not recommended in the git docs, and I'm starting to see why. When I try this, I seem to fix the same