git-rebase

How to retroactively add commits to a Git repository?

我的未来我决定 提交于 2019-12-08 09:05:16
问题 I am creating a module that ports a third party lib to another platform. The version of my module matches the version of the lib that it wraps. For the purposes of this question, let's say that the lib is on version 10, therefore my module is also on version 10. Git refs look like this: master === HEAD === v10 (tag) However, for compatibility reasons, I wish to create versions 8 and 9 of the wrapper as well. If I commit v9 , it will become the new HEAD , but I want HEAD to stay on v10 . I

Git: how to push changes made to only certain files?

早过忘川 提交于 2019-12-08 08:26:42
问题 I recently ran into a problem where I need to select a few files to push to remote branches with git. My specific use case here is there is only one file created/modified in every single commit, and I need to programatically push the selected files (in their latest state). I did a bit of research and found 2 tricks that came close to what I need to do: I can use cherry-pick to pick certain commits into a new branch and merge that branch into the remote master. I can use rebase -i to reorder

How to properly push one git repository over another on codebasehq?

て烟熏妆下的殇ゞ 提交于 2019-12-08 03:54:36
问题 I need to know the proper way to move git history from one repository to another on codebasehq.com. Situation: there is a repo on codebasehq.com which I call "old" on path like mycompany.codebasehq.com/projects/OLDNAME/repositories/PROJECTNAME after some development in old repo the team realized that this repo should actually be in different location on codebasehq.com and did "new" repo with just files from "old" repo and push it to mycompany.codebasehq.com/projects/NEWNAME/repositories

git rebase implementation details

十年热恋 提交于 2019-12-08 01:59:48
问题 I am trying to figure out the working mechanism of git-rebase . Documentation provides information about what git-rebase does, but doesn't comment on how it does? I have looked into the source code, worked out some test cases and so far understand following: 1. Git maintains the state of rebase in .git/rebase-apply (with files like patch, final-commit, head-name etc) 2. Git uses git-format-patch to create all necessary patch files (which are inside rebase-apply) 3. Git uses git-am to apply

How to change git path from C:\cygdrive\c\

和自甴很熟 提交于 2019-12-08 01:54:37
问题 How to change git path from C:\cygdrive\c... to C:\ or just \cygdrive\c\? I have setup notepad++ as my editor for git. When i try to perform an interactive rebase (git rebase -i), notepad opens but cannot find the right files for rebasing due to this weird path that include C:\cygdrive\c... Here is an image of the error message that notepad++ shows... 回答1: Make sure to: use bash: C:\cygwin64\bin\bash.exe --login -i use cygpath to convert Unix and Windows format paths: That is: /cygdrive/c

Can git figure out that the branch to be merged has obsolete changes?

别说谁变了你拦得住时间么 提交于 2019-12-08 01:39:26
问题 I am new in git and I am find it hard to wrap my head around the fact that everything is around snapshots/commits and not individual files. So assume that I have a tree in my repository as follows. C4 (HEAD,Master,Origin/Master) * C3 * C2 * C1 Now I branch out from here: B1 (HEAD, testBranch) * C4 (HEAD,Master,Origin/Master) * C3 * C2 * C1 In my testBranch I only modify 2 files of the whole repository. Just 2. The development in master in the remote repository continues so eventually we have

Local Git branch has diverged from origin following an interactive rebase

烈酒焚心 提交于 2019-12-07 14:37:51
问题 I have a local branch ( CRM-ayrshireminis ) that has a couple of commits on it that I have pushed to the origin ( origin/CRM-ayrshireminis ). This branch was created from the develop branch about one week ago, on which there have been one weeks worth of work from other collaborators. What I want to do is rebase the latest code from origin/develop into my feature branch CRM-ayrshireminis . What I done was: git checkout develop git pull git rebase -i develop CRM-ayrshireminis I had two commits,

Why git rebase shows conflicts in the files I did not modify?

Deadly 提交于 2019-12-07 14:37:26
问题 Let's say that I am on a local repo and its branch is my_name/branch_A When I do git rebase <branch_B> , I sometimes get many conflicts in the files that I did not modify. Why does this happen? I like to just get the HEAD of all the files from branch_B except for the ones I modified in my_name/branch_A . How can this be done without manually resolving these conflicts that I did not introduce myself. 回答1: Rebase copies commits (and then abandons the originals). This is the root of the problem.

Executing a git-hook after pull --rebase

╄→尐↘猪︶ㄣ 提交于 2019-12-07 05:06:37
问题 I'd like to have a hook run after doing git pull --rebase in order to check if a certain file was changed. Something along the lines of this hook. I initially thought of using the post-rewrite hook, however that only works when commits are being rewritten, and won't run when the pull operation simply fast-forwards the branch, which is very often. Any ideas will be appreciated. 回答1: I ran strace git pull --rebase on a local repository, which performed a fast-forward update... First, rewinding

How to Reorder Commits (rebase) with TortoiseGit

此生再无相见时 提交于 2019-12-07 00:08:02
问题 I want to push several single commits to our main git repository. After doing some reading though it sounds like I have to reorder the commits in order to do this, because git will only push all commits up to a specified commit. First, I don't really understand why this isn't just built in to git (I'm a git newbie). Regardless, I need to reorder the commits and I'm using TortoiseGit. I've found how to get to the rebase menu, but I don't know which options to choose. To get to the rebase menu