git-branch

Git - move pushed commits to a new branch (rename branch instead of force pushing?)

こ雲淡風輕ζ 提交于 2019-12-10 11:08:48
问题 There is another question that describes my situation almost exactly (Git - Moving Pushed Commits to a Different Branch). The only difference is that the commits that I would like to move are in the Develop branch rather than master (which shouldn't matter because there's nothing special about the master branch). Also, we have redmine linked to our git repositories. Anyway, there was a comment by user Adam to the accepted answer: Don't ever use push --force, it's a bad idea. It will seriously

Move uncommitted changes from current branch to another branch that conflicts with those changes

a 夏天 提交于 2019-12-10 10:48:16
问题 Suppose I am on branch master and I start making some changes. I make the changes to a file which is already opened in Emacs (so under the hood, as checkouts happen, Emacs is unaware unless I revert-buffer constantly). The file did exist in branch other_branch which was intended to be merged into master later on. But the file did not exist in master until I accidentally saved it from Emacs. The changes are uncommitted, but I realize that I shouldn't have been making the changes on master and

Collecting a list of all branches in a repository in a special format [Git]

眉间皱痕 提交于 2019-12-10 10:44:41
问题 Is there a way to collect a list of the branch in a repository and there last commit date? In other words, I would like to print something like this to the stdout: branch_name_1 date1 branch_name_2 date2 branch_name_3 date3 Is it possible? EDIT : I tried to use the following steps: git log --pretty=format:"%ad:%an:%d:%B" --date=short --branches git branch -a git ls-remote –heads each one of them gives me the branches of the repository which I currently in. But now I would like to check if it

Can not create a local and remote branch (tracking) at the same time

房东的猫 提交于 2019-12-10 01:21:28
问题 From Pro Git: you can set up other tracking branches if you wish — ones that don’t track branches on origin and don’t track the master branch. The simple case is the example you just saw, running git checkout -b [branch] [remotename]/[branch] $ git checkout --track origin/serverfix Branch serverfix set up to track remote branch refs/remotes/origin/serverfix. Switched to a new branch "serverfix" $ git checkout -b sf origin/serverfix Branch sf set up to track remote branch refs/remotes/origin

How do I determine the source branch of a particular branch?

我的梦境 提交于 2019-12-10 00:35:22
问题 I have a branch in git and want to figure out from what branch it originally was branched and at what commit. Github seems to know, since when you do a pull request it usually automatically sets up what branch it should go into, but I can't figure out how to do this manually from the command line. Let me add a concrete example: master -- ongoing development 2.2 -- stable maintenance A feature branch feature was created (at commit B below) and worked on ( B' , C' & E' ) and merged against the

Deploy git branches

做~自己de王妃 提交于 2019-12-09 23:37:19
问题 After struggling with and sorting out a workflow for web development with git, I've been tasked with adding in a staging server at the last second. We develop/test locally and push out to a repo, and now there needs to be a sandbox in between so people in other departments can play around and try out new things without breaking stuff. Remote repo needs two long-running branches (in the spirit of nvie's branching model), master and develop. We need to be able to push to one repo, and checkout

git branch workflow policy

不问归期 提交于 2019-12-09 18:44:03
问题 I am new to git and understand a little bit about Git. My company is currently have 1 program and the program divides into 5 products. each product is handling by different team. Currently my company git have 5 branches such as : dev = this branch is for developer to build program (dev.program.com) test(alpha) = this branch is for tester to test the program (test.program.com) staging(beta) = this branch is for tester test the program (double check of error ) and client test the program. (stg

Git branch structure for Client & Server

可紊 提交于 2019-12-09 18:33:41
问题 For one of my CS classes, I and a group are writing an application using a client/server architecture. I was curious what the best-practices would be for organizing the project in a Git repository. What I mean, is whether we should structure the directories like this: ProjectDir/ Clients/ Client1/ # files... Client2/ # files... Server/ files.... and track everything on the same git branch, or whether we should create separate branches for the clients and the server, like: on branch Server :

How to make a new branch in Visual Studio 2015?

半城伤御伤魂 提交于 2019-12-09 14:16:48
问题 I am using Git with Visual Studio Online in Visual Studio 2015 and am trying to figure out how to create a branch. This is the usual answer on the internet: https://msdn.microsoft.com/en-us/library/hh850437.aspx & https://msdn.microsoft.com/en-us/library/jj190809.aspx#create If you check the image it shows the branch and the drop down arrow where I assume you can create a branch. But in Visual Studio 2105 the dropdown is not there and when I click on the link it goes to branches. But there is

How to set a git branch to push to a remote with a different branch name and pull from completely different url

风流意气都作罢 提交于 2019-12-09 10:58:32
问题 My local git repo needs to pull from one server. It then needs to push a specific branch to a review repo with a different branch name on a different server. Something like: Pull everything from PullOnlyRepo on Server1 (we'll call that origin maybe?) Push Branch hotfix to ReivewRepo with branch name JistChanges on Server2. Right now git config -l shows: remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* remote.origin.url=<URL for Server1> remote.origin.pushurl=no_push (this shouldn't