version-control

How can I reset or revert a file to a specific revision?

别说谁变了你拦得住时间么 提交于 2019-12-17 07:52:49
问题 I have made some changes to a file which has been committed a few times as part of a group of files, but now want to reset/revert the changes on it back to a previous version. I have done a git log along with a git diff to find the revision I need, but just have no idea how to get the file back to its former state in the past. 回答1: Assuming the hash of the commit you want is c5f567 : git checkout c5f567 -- file1/to/restore file2/to/restore The git checkout man page gives more information. If

How can I reset or revert a file to a specific revision?

懵懂的女人 提交于 2019-12-17 07:52:42
问题 I have made some changes to a file which has been committed a few times as part of a group of files, but now want to reset/revert the changes on it back to a previous version. I have done a git log along with a git diff to find the revision I need, but just have no idea how to get the file back to its former state in the past. 回答1: Assuming the hash of the commit you want is c5f567 : git checkout c5f567 -- file1/to/restore file2/to/restore The git checkout man page gives more information. If

git commit frequency

对着背影说爱祢 提交于 2019-12-17 07:10:11
问题 Since i switched to git from svn i started make more commits every time i recompile and my tests pass i commit my work. In the end i end up committing function by function. I also track some other projects using git like emacs,wordpress etc. I see that they do not commit that often. So i am wondering how ofthen do you commit? 回答1: The guideline for the Git project itself (and the Linux project, AFAIK) is one commit per "logically separate changeset". This is a little ambiguous, but you

git-svn: what's the equivalent to `svn switch --relocate`?

徘徊边缘 提交于 2019-12-17 07:04:39
问题 An svn repository I'm mirroring through git-svn has changed URL. In vanilla svn you'd just do svn switch --relocate old_url_base new_url_base . How can I do this using git-svn? Simply changing the svn url in the config file fails. 回答1: This handles my situation pretty well: https://git.wiki.kernel.org/index.php/GitSvnSwitch I cloned using the file:// protocol, and wanted to switch to the http:// protocol. It is tempting to edit the url setting in the [svn-remote "svn"] section of .git/config

Branching Strategies [closed]

六眼飞鱼酱① 提交于 2019-12-17 07:00:47
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . The company I work for is starting to have issues with their current branching model and I was wondering what different kinds of

Branching Strategies [closed]

元气小坏坏 提交于 2019-12-17 07:00:08
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . The company I work for is starting to have issues with their current branching model and I was wondering what different kinds of

Should composer.lock be committed to version control?

[亡魂溺海] 提交于 2019-12-17 06:58:26
问题 I'm a little confused with composer.lock used in an application with a repository. I saw many people saying that we should not .gitignore composer.lock from the repository. If I update my libraries in my dev environment, I will have a new composer.lock but I will not be able to update them into production, will I ? Won't it generate conflicts on this file ? 回答1: If you update your libs, you want to commit the lockfile too. It basically states that your project is locked to those specific

Can git be integrated with Xcode?

亡梦爱人 提交于 2019-12-17 06:23:05
问题 Is there any way to use a git repository with the built in SCM functions of Xcode? 回答1: Xcode 4 supports git natively (Developer Tools State of the Union Address at WWDC 2010) Learn more here: What's new in Xcode 4 The documentation from Apple is lengthy, but a good read. 回答2: NOTE: despite all the up-votes, this answer is out of date as of June 2010 There's no git support within Xcode, but that's no reason not to use git for your Xcode projects. I've had good results managing my Xcode

Can we finally move to DVCS in Corporate Software? Is SVN still a 'must have' for development? [closed]

不打扰是莪最后的温柔 提交于 2019-12-17 05:41:07
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 9 years ago . Git/Mercurial have been becoming more and more popular. I have seen plenty of articles comparing SVN with Git/Mercurial, but I am

Moving from CVS to Git: $Id:$ equivalent?

大城市里の小女人 提交于 2019-12-17 04:40:55
问题 I read through a bunch of questions asking about simple source code control tools and Git seemed like a reasonable choice. I have it up and running, and it works well so far. One aspect that I like about CVS is the automatic incrementation of a version number. I understand that this makes less sense in a distributed repository, but as a developer I want/need something like this. Let me explain why: I use Emacs. Periodically I go through and look for new versions of the Lisp source files for