pull

Discard all and get clean copy of latest revision?

ε祈祈猫儿з 提交于 2019-12-04 07:23:04
问题 I'm moving a build process to use mercurial and want to get the working directory back to the state of the tip revision. Earlier runs of the build process will have modified some files and added some files that I don't want to commit, so I have local changes and files that aren't added to the repository. What's the easiest way to discard all that and get a clean working directory that has the latest revision? Currently I'm doing this: hg revert --all <build command here to delete the contents

Unable to Git Pull to update my Git local repo

不羁岁月 提交于 2019-12-04 05:01:42
I removed a file in my local Git repo. I want the file back by updating my Git repo. I run the following unsuccessfully git pull It says upToDate, but I did not get the newest file. The public repo at github does not use SVN, so the problem cannot be SVN. How can you update your local Git repo , such that you get your removed File back to your computer? August has the probably best way for your problem. You could also revert to the last version you pulled: git reset --hard If it hasn't been committed yet: git checkout path/to/file 来源: https://stackoverflow.com/questions/842915/unable-to-git

How to set Mercurial upstream

喜你入骨 提交于 2019-12-03 23:50:42
I created local hg repository for new project: hg init ; hg addremove , then I created empty upstream repo, and pushed first version there: hg push https://remoterepo . Now, I want to set that https://remoterepo as default upstream, so I can just do hg push/pull without giving it. I was surprised Google did not give me a straight answer with "set mercurial upstream", and I didn't find a direct answer here at SO either. So, for the benefit of all the people using SO as a howto, what's the right way to do this? You can do that by adding the upstream URL to /project/.hg/hgrc like this: [paths]

Is 'pull' a synonym for 'clone' in a Mercurial source-control repository?

假如想象 提交于 2019-12-03 20:09:43
问题 I'm seeing the command 'pull' and wondering how that's different from a 'clone'. Both terms seem to imply retrieving code from some remote repository. Is there some subtle distinction here? 回答1: hg clone is how you make a local copy of a remote repository. The Subversion equivalent is svn checkout . hg pull pulls changes from another repository. hg update applies those changes to the local repository. hg pull -u is equivalent to hg pull; hg update . The Subversion equivalent to hg pull -u is

Ignore specific files when pulling from forked upstream origin

感情迁移 提交于 2019-12-03 15:53:36
In git, how do you exempt certain files when pulling from an upstream origin (i.e. the original project)? I have a project that I'm working on that was originally forked from a repository that is very active. I've added the original as a remote named "upstream" so that it's possible to run: git pull upstream and update the project to the most recent commit. The problem: there are some files (e.g. my Gruntfile.js ) that I do not want to update alongside the original project. Whenever I pulled these commits, I would get merge conflicts because I've changed the files in my own version. I do want

How do I hook a git pull on the remote?

﹥>﹥吖頭↗ 提交于 2019-12-03 12:19:39
问题 Is there a way to hook when a git pull happens on the remote (similar to a pre-receive or post-receive). Basically I'd like to be able to cause the remote to commit whatever it has when there is a pull. In my situation, whatever is live on the remote is an authoritative source which may get modified without a git commit. I want to make sure when I pull I'm always able to get the latest of whatever is live. 回答1: First, to answer your actual question: there are no hooks invoked on the remote

用网上邻居向他人共享Git仓库

非 Y 不嫁゛ 提交于 2019-12-03 10:51:26
有时候,需要把git仓库(包括当前状态和历史记录)共享给车间工友,而你和工友之间又不能通过git服务器进行交互时,网上邻居共享便成为了最原始也最有效的手段。那具体怎么操作呢? 打包整个目录 即把工作区和.git一起打成一个压缩包共享。解压之后即形成完全一样的工作环境。 毋庸置疑,这是最差的方式,不解释。 打包.git目录 即只把.git目录打成压缩包共享。这样解压之后,去.git的同级目录执行git checkout,即可生成整个工作区。 这里利用了git最重要的特性:.git目录包含了所有信息。 已经很好了,但并不完美。 直接共享.git目录 这是正解。它与打包.git目录的区别在于:被共享的.git目录可以直接被用作远程仓库。 也就是说,如果你的机器名是Machine,被共享的.git目录的共享名为Rep,则 //Machine/Rep 可以直接作为仓库URL来使用。 (1) 克隆 git clone //Machine/Rep <dir> (2) 在现有仓库中添加为远程仓库 git add <name> //Machine/Rep git fetch <name> git checkout master git merge <name>/master git push <name> master:mymaster 可以被添加为远程仓库,是直接共享.git目录的最大优势

Opposite of `git push --mirror`? How do I get my repo back?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 07:47:48
I am having great success with git push --mirror to make backup copies to a bare repo. But after search on SO and elsewhere, I cannot find a way to clone the thing locally with all branches. I do not want to use git clone since I don't want my local repo to know about the bare repo. If I use git pull it only brings down the HEAD branch. Guessing: git pull /data/Dropbox/backup/that_stuff.git * gets me nowhere, of course. How do I get the entire repo with all branches back again? I realize I could probably just copy the bare repo to my .git directory, but that seems like a bad idea. VonC Try git

Why do I sometimes see an “Entry 'filename' not uptodate. Cannot merge.” after a 'git reset --hard' and a 'git pull'?

て烟熏妆下的殇ゞ 提交于 2019-12-03 07:06:29
问题 Occasionally, when I do the following... git reset --hard HEAD is now at 0123abde comment is here git pull Updating 0123abde..456789fa I get the error... error: Entry 'filename' not uptodate. Cannot merge. The only workaround I have found is to 'git reset --hard', delete the offending file(s) then do 'git pull'. That doesn't seem right to me. Shouldn't a hard reset remove any and all local changes thus allowing me to pull the latest without any merge issues? Am I using git wrong? :) This is

Recursive Git push/pull?

青春壹個敷衍的年華 提交于 2019-12-03 06:50:18
问题 I have a git repository that contains other git repositories. Are there commands that recursively push and/or pull for not only the meta-repository but the sub-repositories? 回答1: if you are talking about submodules, see cupcakes answer. if you are talking about some folder hierarchy containing git repos, you can checkout clustergit , a tool i programmed: https://github.com/mnagel/clustergit 回答2: I find myself in the same situation whenever I want to update my llvm/clang repositories and with