git-branch

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

这一生的挚爱 提交于 2019-11-30 09:26:14
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 "B" runs git branch remoteA/newfeature developer "B" works on this branch, commit his work and pushes

How to get information where branch starts?

折月煮酒 提交于 2019-11-30 07:28:43
As far as I know, commit object contains information only about parents, so if I have situation something like this: * branch-1 | o | o master | o which is some kind of equivalent of * branch-1 | o / o master | o but what if my master will go forward? o master | o * branch-1 | | o o |/ o | o being on branch-1, git log --graph --decorate will show me only: * branch-1 | o | o | o if I know from which branch I was started, I can call git merge-base master branch-1 , but what if I don't know from which branch I was started? PS. I am still learning English, however sometimes I am making stupid

Git Tracking Upstream

孤街醉人 提交于 2019-11-30 07:25:15
I am working on a project and I have a central git repo. This project is a skeleton to be a baseline for a number of forks. Is it possible to configure my local working repository for a fork to track the central for the project as origin and track the skeleton's master as a separate branch named upstream tracking the master of the skeleton to cherry pick changes to the skeleton? I guess I want my workflow to be something like: Create Skeleton >> Fork Skeleton >> Skeleton Pulls Changes from Fork 2 >> Fork 1 Pulls Changes from Skeleton Is there a better process to do what I have described? Read

Get new upstream branch with git

最后都变了- 提交于 2019-11-30 06:50:11
I've forked a repo and all of my work goes into that fork (my origin) and I merge branches upstream with pull requests. Pretty standard. But now there's a new branch in the upstream repo and I can't quite figure out how to get that new branch locally and then push it to my origin. Here is my situation. $ git remote show origin * remote origin Fetch URL: git@github.com:rackspace/jclouds.git Push URL: git@github.com:rackspace/jclouds.git HEAD branch: master Remote branches: 1.5.x tracked master tracked Local branch configured for 'git pull': master merges with remote master Local ref configured

How to 'git pull' into a branch that is not the current one?

自闭症网瘾萝莉.ら 提交于 2019-11-30 05:50:12
问题 When you run git pull on the master branch, it typically pulls from origin/master . I am in a different branch called newbranch , but I need to run a command that does a git pull from origin/master into master but I cannot run git checkout to change the selected branch until after the pull is complete. Is there a way to do this? To give some background, the repository stores a website. I have made some changes in newbranch and deployed them by switching the website to newbranch . Now those

Issue with git pull master is out of sync with origin master

杀马特。学长 韩版系。学妹 提交于 2019-11-30 05:13:18
These are the sequence of steps I have performed: committed my changes in branch to local master (commit id dc9afg2k ) git fetch origin master && git merge origin master git checkout master git pull (this pulled all recent changes) git fetch origin master && git merge origin master git reset --hard origin/master git checkout branch git blog git reset --hard dc9afg2k (commit successful) git checkout master git log (this was gone back to 2 days ago). git pull ( master is not updating with current origin/master ). VonC An out of sync master can happen when the remote repo has received a forced

Freezing a Git branch

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 04:46:31
Let's say I have a develop branch. I create a feature branch from this to develop a feature. Once the feature is developed, it is merged back into develop. Pretty much like shown here: Is there a way I can freeze the feature branch so that no further commits can be made to it? The reason for not outright deleting the branch is so that viewing the history can still show the feature branch and that if there needs to be a tweak made to the feature then it is possible for someone to create a new feature branch from the last commit of the previous feature. gjcamann Christopher is right, tagging

Why doesn’t a git tag show up on any branch?

て烟熏妆下的殇ゞ 提交于 2019-11-30 04:16:18
问题 I cloned the mosquitto repo that has tag v1.4.9. However the tagged commit does not appear to be on a branch. How could that happen? Does the author actually keep a branch on his own repo but only push tags from that branch to GitHub? Or does he just make a commit to a tag? I made the tag into a local branch $ git checkout -b work149 v1.4.9 and looked at the last commit on the branch: $ git log -1 commit 91bfd82491f90e24b6fe9c036f0b04a1f5c14a89 Merge: bf959ef 2d0af73 Author: Roger A. Light

Git change branch when file of same name is present

馋奶兔 提交于 2019-11-30 03:06:35
I have in my git repo, a file named xyz. Coincidently, I also have a branch named xyz. Presently I am on master, but I want to checkout to branch xyz. The command to be used is simple $ git checkout xyz But this would checkout the file xyz to the present HEAD. How would I change my branch to branch xyz ? As illustrated by commit a047faf (git 1.8.4.3+), you can also try: git checkout xyz -- (Note: the error message will be clearer with Git 2.21, Q1 2019 ) That would make clear that the xyz part is a branch or commit, while everything after -- must be a path (here no path is provided). See more

create a git symbolic ref in remote repository

北城以北 提交于 2019-11-30 01:16:24
问题 In my remote bare repository the HEAD is pointing to "refs/heads/master" and I want it to point to "refs/heads/other". I am not able to go to remote repository directory and run git symbolic-ref . Is there any git command to achieve it? Or any other way? If there is no way, does Github allow one to change the HEAD? Thanks in advance. 回答1: To change it in github, go to the admin section. You can select the default branch from a dropdown there. 回答2: (There has been posted another question