git-checkout

dot sign's meaning in git checkout command

半世苍凉 提交于 2019-11-29 15:26:58
问题 if I use git command like this: git checkout -- . I know its effect is to discard all unstaged files everywhere. Can anyone tell me what is the meaning of the dot sign (.) in this command? 回答1: The dot stands for the current directory. The command you've mentioned means: Do a git checkout of the current directory (recursively). The double-dashes separate options from filespecs (like . ). 回答2: The dot ( . ) refers to the current working directory. You are asking git to checkout the current

Why doesn't setting GIT_WORK_TREE work in a post-commit hook?

前提是你 提交于 2019-11-29 15:08:49
问题 I'm trying to use the following post-commit hook to deploy to a particular directory after each successful commit: #!/bin/sh export GIT_WORK_TREE=/var/www/example/ export GIT_DIR=/home/mark/test/.git/ git checkout -f However, after committing I get the following error: $ git commit -m 'An example commit.' fatal: Unable to create '/var/www/example/.git/index.lock': No such file or directory [master 0938e48] An example commit. ... as if the GIT_WORK_TREE setting is being ignored. Why does

Git hook creation - You are on a branch yet to be born

懵懂的女人 提交于 2019-11-29 08:49:29
So im setting up a git and following this guide http://toroid.org/ams/git-website-howto . I get as far as this command: # GIT_WORK_TREE=/home3/trncprop/public_html/tpcapp git checkout -f And get the following error message fatal: You are on a branch yet to be born Does anyone know what I am doing wrong? Thanks in advance! Littleswany That command is supposed to be in a hook, not to be executed directly in website.git $ cat > hooks/post-receive #!/bin/sh GIT_WORK_TREE=/var/www/www.example.org git checkout -f $ chmod +x hooks/post-receive That means you need to create a website.git/hooks/post

Checkout the git commit corresponding to a certain revision from the old SVN repository?

我怕爱的太早我们不能终老 提交于 2019-11-29 07:46:20
I migrated my repository from SVN to git. I used THIS site. Now I have a bug in revision X. How do I checkout from my git repository, knowing only the revision number from my old SVN repo? Thank you for your Help. You can find the git commit that corresponds to the Subversion revision with the git svn find-rev subcommand. For example, if you're looking for the commit that corresponds to Subversion revision 3431 you can do: $ git svn find-rev r3431 42ed8bcf690fd0c655c5cee91b09258318fc56e8 Then, to checkout that revision, just use the object name from the first line, e.g. if it's: commit

Git: How do you checkout all deleted files?

泪湿孤枕 提交于 2019-11-29 03:44:14
问题 In git I am familiar with how to checkout individual files that have been deleted using the git checkout -- [<paths>...] syntax (which is recommended when you do git status . To get all the files you could create a list and give the list as the argument to the above command. However when you just want all the files that have been deleted (i.e. rm -rf in your cwd and then you want to restore all files) generating that list is inelegant. How do you checkout all deleted files? 回答1: Generating

error: pathspec 'test-branch' did not match any file(s) known to git

落爺英雄遲暮 提交于 2019-11-29 00:21:44
问题 I am a new user of Git. I have forked a repository called Spoon-Knife (available for practicing forking with Git). Then, I cloned it locally by running git clone https://github.com/rohinichoudhary/Spoon-Knife.git This repository contains three branches, i.e. master , test-branch , change-the-title . When I run git branch , it only shows *master , not the remaining two branches. And when I run git checkout test-branch I get the following error: error: pathspec 'test-branch' did not match any

Convert an SVN checkout to use git (git-svn)

谁都会走 提交于 2019-11-28 22:36:10
I work with software that is kept in svn for version control. I would like to use git (git-svn) however the software requires lots of setup and configuration before it can be used. There are tools that take care of all of the setup, including checking out all the code via svn. All the documentation for git-svn (I've been able to find) requires a fresh checkout, using git-svn. Is there a way to convert an existing svn checkout so it can use git-svn? You could do something like this: Do a full clone of your SVN tree using git-svn, to a temporary directory. Make sure you use the exact same

Is there a way to use wildcards with git checkout?

此生再无相见时 提交于 2019-11-28 20:46:57
问题 What I would like to do is to checkout a single file or a set of files with a common name part like this git checkout myBranch */myFile.md and git checkout myBranch -- */*Test* (not sure about the '--' part) instead of git checkout myBranch src/main/java/a/deep/package/structure/myFile.md and git checkout myBranch src/test/java/a/deep/package/structure/TestOne.java git checkout myBranch src/test/java/a/deep/package/structure/TestTwo.java git checkout myBranch src/test/java/a/deep/package

Strange behaviour of Git: mysterious changes cannot be undone

不想你离开。 提交于 2019-11-28 20:34:41
I am seeing a behaviour in Git which seems very mysterious to me. I keep a clone of the Linux repository from Github to play with Git locally. To be clear, I don't do much in this repository : I fetch changes, update master , checkout a specific version, and sometimes I try out a Git GUI to see what the visualization looks like on a big project. TLDR version: I never did any changes to the files in it . Strange behaviour Earlier today, I checked-out master and pulled changes from Github. Everything seemed to go fine. But I suspect it actually didn't. This is what git status looks like now.

Active Git branch is “(no branch)” on hudson CI

我的未来我决定 提交于 2019-11-28 18:23:24
My Ant build.xml script starts with <property environment="env"/> <echo>GIT_BRANCH = ${env.GIT_BRANCH}</echo> <echo>PWD = ${env.PWD}</echo> Hudson CI is setup to build when any branch changes. Console output is... Commencing build of Revision 90906a63929e9074035eb5b10c71ee055ad3e13c (origin/DPM-48) GitAPI created Checking out Revision 90906a63929e9074035eb5b10c71ee055ad3e13c (origin/DPM-48) [workspace] $ git.exe checkout -f 90906a63929e9074035eb5b10c71ee055ad3e13c [workspace] $ cmd.exe /C '"C:\Program Files\WinAnt\bin\ant.bat" -file build.xml ...' [echo] GIT_BRANCH = ${env.GIT_BRANCH} [echo]