Git reverse squirrel

My question is, is there a way to mark a specific commit (s) so that it either is not merged into another branch, or will it be ignored when issuing a "git push" or retrieving from another repository?

My understanding is that you can choose special commits to hang in the current branch; is there any way to mark commit as "local" for a particular machine / repository / branch?


The problem that this issue has grown up with is currently being addressed differently. In particular, there is a certain version of sqlite3-ruby (1.2.5) that is required to work with a Rails application on one OSX machine, to which I do not have root access. Now I have committed to specify the version in the Gemfile in the local branch named "mac-bundle", and my plan is to simply switch to this branch and merge the necessary changes before starting the package if I need to install a ruby ​​stone.

This is a minor but lively annoyance. It seems possible that a similar situation may arise when the same workaround is not so acceptable, so I thought that I would ask for ideas on a different solution.

(The question is similar to this: Machine-specific configuration files , and my current solution is similar to Greg Huglill's answer.)

+3
source share
2 answers

No, there is no way to mark a commit as "do not merge." Using individual branches is almost as close as it gets.

+4
source

No, you can’t. However, you can "fake commit" on a specific branch.

To do this, you can

git merge OtherBranchName --no-commit

This applies to the changes and leaves them in the index so that you can take action. Then you can manually delete the changes and commit.

Git then thinks that the commit was applied in this thread, and you are both happy after that.

, , , . .

+2

Source: https://habr.com/ru/post/1787640/


All Articles