version-control

How do I commit a git tag?

雨燕双飞 提交于 2020-01-01 01:53:15
问题 I have successfully made, committed, and pushed changes to a central git repository. I realize now that I want to tag the current version of all files. So I do: git tag -a 0.5 That succeeds. But now I try a git push and I am told there's nothing to commit. How do I push my new tag to the central repository? (Note that git tag shows the tag 0.5, but only locally) 回答1: I think you want git push --tags as that, well, pushes all your tags :) There are some alternatives of course, this being git

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

merging changes from a maven release branch yields conflicts due to changed versions in poms

丶灬走出姿态 提交于 2020-01-01 00:29:33
问题 following standard practice, I have an svn trunk for feature development, and a forked-off branch for building releases. The branch has been created using the maven release plugin, which is also used for creating releases. As it happens, the occasional bug will be fixed on the branch, and those changes need to be merged back into the trunk. To not miss any changes, I'd like to be able to simply merge the complete branch back into the trunk. Now my problem is that I get numerous conflicts in

How to ignore existing file in Git?

风格不统一 提交于 2019-12-31 21:37:11
问题 I need to work on file.txt locally and in Git, with different content. I want Git not to tell me that there have been changes to that file. Is this possible? 回答1: Actually, you want --skip-worktree , not --assume-unchanged . Here's a good explanation why. So git update-index --skip-worktree file.txt TLDR; --assume-unchanged is for performance, for files that won't change (like SDKs); --skip-worktree is for files that exist on remote but that you want to make local (untracked) changes to. 回答2:

How to ignore existing file in Git?

孤人 提交于 2019-12-31 21:37:08
问题 I need to work on file.txt locally and in Git, with different content. I want Git not to tell me that there have been changes to that file. Is this possible? 回答1: Actually, you want --skip-worktree , not --assume-unchanged . Here's a good explanation why. So git update-index --skip-worktree file.txt TLDR; --assume-unchanged is for performance, for files that won't change (like SDKs); --skip-worktree is for files that exist on remote but that you want to make local (untracked) changes to. 回答2:

SQL version control methodology

…衆ロ難τιáo~ 提交于 2019-12-31 12:56:12
问题 There are several questions on SO about version control for SQL and lots of resources on the web, but I can't find something that quite covers what I'm trying to do. First off, I'm talking about a methodology here. I'm familiar with the various source control applications out there and I'm familiar with tools like Red Gate's SQL Compare, etc. and I know how to write an application to check things in and out of my source control system automatically. If there is a tool which would be

Seeking examples of workflow using git-format-patch and git am

*爱你&永不变心* 提交于 2019-12-31 12:15:12
问题 I'm thinking of asking my students to use git for pair programming. Because student work has to be secret, a public repo is out of the question. Instead, each student will have a private repo they maintain themselves, and they will need to exchange patches using git-format-patch. I've read the man page but I'm a little unclear which patches will be sent. The obvious thing for the students would be send all patches since the last send or (if git doesn't mind receiving the same patches

How do I synchronise two remote Git repositories?

末鹿安然 提交于 2019-12-31 10:36:00
问题 I have two repository urls, and I want to synchronise them such that they both contain the same thing. In Mercurial, what I'm trying to do would be: hg pull {repo1} hg pull {repo2} hg push -f {repo1} hg push -f {repo2} This will result in two heads in both repos (I know it's not common to have two heads, but I'm doing this for synchornisation and it needs to be non-interactive. The heads will be merged manually from one of the repos and then the sync run again). I'd like to do the same thing

Is using “feature branches” compatible with refactoring?

拈花ヽ惹草 提交于 2019-12-31 10:33:02
问题 “ feature branches ” is when each feature is developed in its own branch and only merged into the main line when it has been tested and is ready to ship. This allows the product owner to choose the features that go into a given shipment and to “park” feature that are part written if more important work comes in (e.g. a customer phones up the MD to complain). “ refactoring ” is transforming the code to improve its design so as to reduce to cost of change. Without doing this continually you