branch

Removing a specific commit in the git history with several branches?

江枫思渺然 提交于 2019-12-22 20:44:05
问题 I know how to remove a specific commit from the git history with git rebase --interactive . My question concerns the more complex case with a history like this: A--X--B--C--D \ E--F where I would like to remove the commit X . The issue is that in this case there are two or more branches with parents ( B in this case) that have X in their history, so a single git rebase -i will not do the trick (at least I do not know how). Is there a simple way to remove X , or do I have to rely on rebasing

GitHub Branches: Case-Sensitivity Issue?

耗尽温柔 提交于 2019-12-22 18:37:14
问题 I seem to be having an issue with a repository continually recreating branches locally because of some branches on remote. I'm on a Windows machine, so I suspect that it's a case sensitivity issue. Here's an example couple commands: $ git pull From https://github.com/{my-repo} * [new branch] Abc -> origin/Abc * [new branch] Def -> origin/Def Already up to date. $ git pull -p From https://github.com/{my-repo} - [deleted] (none) -> origin/abc - [deleted] (none) -> origin/def * [new branch] Abc

Routinely sync a branch to master using git rebase

北城以北 提交于 2019-12-22 18:27:27
问题 I have a Git repository with a branch that hardly ever changes (nobody else is contributing to it). It is basically the master branch with some code and files stripped out. Having this branch around makes it easy for me to package up a leaner version of my project without having to strip out the code and files manually every time. I have been using git rebase to keep this branch up to date with the master but I always get this warning when I try to push the branch after rebasing: To prevent

Is they a way to set push.default to `current` only for the current push

拜拜、爱过 提交于 2019-12-22 18:10:05
问题 I have setup the push.default option to simple in my git config, because I think it makes more sense so that I don't create unwanted branches on my remote repository if I push something inadvertendly. However, sometimes, I know that this push is going to create a new branch in the remote, so I'd like to tell git that for this specific command, I'm willing to change the push.default config to current (so that it creates a branch of the same name as the one I'm currently in), but only for that

Is they a way to set push.default to `current` only for the current push

坚强是说给别人听的谎言 提交于 2019-12-22 18:08:15
问题 I have setup the push.default option to simple in my git config, because I think it makes more sense so that I don't create unwanted branches on my remote repository if I push something inadvertendly. However, sometimes, I know that this push is going to create a new branch in the remote, so I'd like to tell git that for this specific command, I'm willing to change the push.default config to current (so that it creates a branch of the same name as the one I'm currently in), but only for that

Retroactively treat line of Git commits as a branch

谁说胖子不能爱 提交于 2019-12-22 14:03:51
问题 A bunch of questions ask how to rewrite ( rebase ) some commits so that they appear on a branch, but these all seem to assume that rebase is actually necessary, i.e. that the commits wanted for the branch are interspersed with commits wanted on master (whether made by “you” or others). This question is simpler: I have a clone of a repository on the master branch, and I made a bunch of commits intending to create a GitHub pull request. Normally I would have run git checkout -b new-feature

How to make individual pull requests vs “stacking” them on top of each other in Github?

安稳与你 提交于 2019-12-22 10:59:45
问题 I'm not getting anywhere with this... trying to make 2 separate pull requests. Maybe someone can point me to what is wrong. Here is what I'm doing: Fork repo FOO and clone to my machine git clone https://github.com/myself/FOO.git Set upstream to track FOO git remote add upstream https://github.com/maker_of_FOO/FOO.git Create new branch and checkout git branch FOO_fix_1 git checkout FOO_Fix_1 Edit files and commit and push git commit git push Push new branch to my fork of FOO git push -u

How can I get track of several projects in Git that share common code?

瘦欲@ 提交于 2019-12-22 08:28:36
问题 I have developed a website that now has to be cloned for several clients. Each client wants customizations that go beyond visual aspects and cannot be handled by profiles, preferences or something like that. With this scenario, I would like to mantain a master repository in Git with the common code, and then one branch for each client. This way, I can make individual changes in every client (branch) and share common changes as well (using the master). Is this approach correct? Is there any

Why would my local changes in Git be overwritten by checkout in this circumstance?

无人久伴 提交于 2019-12-22 06:44:30
问题 Say I have a branch A, and from that I branch B. I make a bunch of changes on A, then checkout B and do a git pull . Now I make a change on B but realize that it should've been in A. If I now try to git checkout A , I get "Your local changes to the following files would be overwritten by checkout" to the file I touched. Why would my change be overwritten if I just did a git pull in B and haven't touched that file in A since? 回答1: The reason you get that message is that the underlying file

How to set tracking on an existing repo to a remote repo with ngit (or jgit)?

蓝咒 提交于 2019-12-22 06:38:14
问题 I am working on a gui based helper utility that will: Init a local repo, Init (bare) a remote repo Add .gitignore based on a project type Commit all the files locally Add a remote repo to the local config Push master to the remote repo Create a develop branch and push it to master All this is done without git installed by using ngit (.NET port of jgit). But I can't figure out how to setup tracking to track master to origin/master and develop to origin/develop using just ngit . I can do it