git-branch

Git branching / rebasing good practices

拥有回忆 提交于 2020-01-01 08:49:32
问题 I have a following scenario: 3 branches: - Master - MyBranch branched off Master for the purpose of developing a new feature of the system - MyBranchLocal branched off MyBranch as my local copy of the branch MyBranch is being rebased against and pushed to by other developers (who are working on the same feature as I am). As the owner of the MyBranch branch I want to keep it in sync with Master by rebasing. I also need to merge the changes I make to MyBranchLocal with MyBranch. What is a good

Sharing files across branches in Git

亡梦爱人 提交于 2020-01-01 01:32:08
问题 There are a bunch of files in my project that are sometimes modified but always shared among many different branches. Examples include build scripts, batch files that include paths, etc. Even the .gitignore file itself is an example. I want this stuff in source control, but I don't want individual branches to keep track of changes to them. How do you handle this situation? Do you track everything related to your project in Git? What's your approach to shared objects? Is .gitignore my only

Sharing files across branches in Git

让人想犯罪 __ 提交于 2020-01-01 01:31:06
问题 There are a bunch of files in my project that are sometimes modified but always shared among many different branches. Examples include build scripts, batch files that include paths, etc. Even the .gitignore file itself is an example. I want this stuff in source control, but I don't want individual branches to keep track of changes to them. How do you handle this situation? Do you track everything related to your project in Git? What's your approach to shared objects? Is .gitignore my only

How to push a new branch non-existing on the remote server without --set-upstream?

江枫思渺然 提交于 2019-12-30 07:09:06
问题 The scenario is that I have no repos on the remote server, just an account. Then, I run locally the following commands, where x is the user name and y is the project name that only exists on my local system. git init git remote add buckety https://x@bitbucket.org/x/y.git git add . git commit --message "Here we go..." git push buckety Now I get the error urging me to set up the remote upstream. I can do that (either --set-upstream or -u ) but according to my googlearching, it's been deprecated

GIT: How to keep ignored files when switching branches?

放肆的年华 提交于 2019-12-30 04:39:05
问题 I have an App.Local.config file which each developer has their own settings in. I do not want this file checked versioned in the GIT repo as every time it would be overwritten by another developers changes. So I deleted the file from the repo and added it to the ignore file. But now when developers switch branches, App.Local.config is deleted from their local filesystem. Ultimately what i would like is: new dev clones repo, gets a starting version of App.Local.config dev makes changes to App

Get new upstream branch with git

北城以北 提交于 2019-12-30 02:09:27
问题 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

Track a new remote branch created on GitHub

泄露秘密 提交于 2019-12-29 10:07:53
问题 I have already got a local master branch tracking the remote master branch of a github project. Now, a collaborator of mine has created a new branch in the same project, and I want to do the following accordingly: create a new branch locally make this new branch track the newly create remote branch. How should I do it properly? 回答1: git fetch git branch --track branch-name origin/branch-name First command makes sure you have remote branch in local repository. Second command creates local

Visual Studio 2013 git, only Master branch listed

谁说我不能喝 提交于 2019-12-28 08:37:30
问题 I'm using Visual Studio 2013's Git support to work on a private GitHub repository. I have permission to commit to it. I want to switch branches, but when I go to the Branches view, the only branch in any of the lists (branch drop-down, published branches, merge tool) is master. Other branches show up in GitHub, GitHub for Windows, and TortoiseGit. So I know they're there and I have access. Any ideas why I can't see other branches in Visual Studio? I'm running Visual Studio 2013 Update 2. 回答1:

git pull all branches from remote repository

故事扮演 提交于 2019-12-28 05:01:23
问题 How do I pull all of the remote branches to my own repository? if I type: git branch -a I get a long list of branches, but if I type: git branch I see only 2 of them. How do I pull ALL branches into my local list? I know I can do: git checkout --track origin/branch-name but that pulls and checks out only one branch at a time. Any way to get it all done at once without that whole tedious work of running git checkout --track origin/branch-name over and over and over again? ps. I tried following

Git Merge and Fixing Mixed Spaces and Tabs with two Branches

走远了吗. 提交于 2019-12-28 03:25:06
问题 I've gone through some similar SOQ's and have not seen an adequate solution for this case. I've noticed that in many files there is a dirty mix of tabs and spaces used for indenting. The coding standard we follow uses 4 spaces for a tab currently. Although this should have been addressed when it happened, I need to consider it now and would like to fix the files I come across. The issue is that there are two teams using different branches of code and we will eventually have to merge those