git-pull

How do I add/upgrade/downgrade a remote Git project in my repository without using submodules?

余生颓废 提交于 2019-11-27 02:23:27
问题 I need to keep a copy of WordPress in my project's Git repository. I want to use Git to pull down WordPress updates from GitHub, and then push out those updates via git push and/or git svn dcommit . I currently have a solution in place using Git submodules, and it works; but now I need to deploy my newest project to a server that only supports SVN, and to which I have no direct access whatsoever. Therefore, submodules are out. I've done a ton of reading on Git's subtree merging strategy, and

git pull fails “unable to resolve reference” “unable to update local ref”

时光总嘲笑我的痴心妄想 提交于 2019-11-27 02:20:24
Using git 1.6.4.2, when I do a git pull I get this error: error: unable to resolve reference refs/remotes/origin/LT558-optimize-sql: No such file or directory From git+ssh://remoteserver/~/misk5 ! [new branch] LT558-optimize-sql -> origin/LT558-optimize-sql (unable to update local ref) error: unable to resolve reference refs/remotes/origin/split-css: No such file or directory ! [new branch] split-css -> origin/split-css (unable to update local ref) I've tried git remote prune origin , but it didn't help. Vojtech Vitek Try cleaning-up your local repository with: $ git gc --prune=now $ git

Pulling just one directory out of a git repo

不羁的心 提交于 2019-11-27 01:57:16
问题 I have a git repo that I want to do a pull from. I do a normal git pull with no problems. The issue is that I want just one certain directory out of the repo. My thinking was that I could use a .gitignore file with a rule like this: #Ignore all files / #Except the one I want !/temp The problem is this doesn't work. Is that the right way to do it or is there a better way? 回答1: git pull fetches and merges the remote branch. .gitignore works only locally, and will hide matching entries from

Git merge flattening

会有一股神秘感。 提交于 2019-11-27 00:34:44
问题 If I am working in multiple branches on a single feature, I use git pull branch1 branch2 branch3 to pull all the changes into my master branch. However, all the commit logs of each branch are copied as well. How do I flatten the commit log down to a single message? 回答1: You can use interactive rebase and "squash" the commits -- see also the Git Ready Tutorial on squashing via rebase. Sorry to just dump a link on you but that's a pretty thorough tutorial. Oh, and this will also squash away

How do I check the date and time of the latest `git pull` that was executed?

吃可爱长大的小学妹 提交于 2019-11-27 00:32:23
问题 How do I check the date and time of the latest git pull that was executed? I frequently need to know when the code changed on a server when something goes wrong. 回答1: The git show command shows the date of the most recent commit. This isn't the date at which the commit was pulled to the local repository, but Git doesn't keep such pull information. You may be able to find the time of the last pull using the ctime (creation time) of the files on the server. For example: ls -lct shows the ctime

Resolve conflicts using remote changes when pulling from Git remote

浪子不回头ぞ 提交于 2019-11-26 23:45:06
问题 I'm trying to pull code from my GitHub repo onto my server, but the pull keeps failing because of merge conflicts. I don't want to keep any of the changes that may have occurred on my local server since the last pull. So is there a way I can force Git to overwrite with whatever version is in GitHub, rather than bother me about conflicts? 回答1: If you truly want to discard the commits you've made locally, i.e. never have them in the history again, you're not asking how to pull - pull means

Git Pull While Ignoring Local Changes?

て烟熏妆下的殇ゞ 提交于 2019-11-26 23:44:35
问题 Is there a way to do a git pull that ignores any local file changes without blowing the directory away and having to perform a git clone ? 回答1: If you mean you want the pull to overwrite local changes, doing the merge as if the working tree were clean, well, clean the working tree: git reset --hard git pull If there are untracked local files you could use git clean to remove them. Use git clean -f to remove untracked files, -df to remove untracked files and directories, and -xdf to remove

How can I fetch an unmerged pull request for a branch I don't own?

≡放荡痞女 提交于 2019-11-26 21:29:16
I need to pull in a specific pull request (that hasn't been processed into the main stream yet) in the NServiceBus repo: https://github.com/johnsimons/NServiceBus/commit/d8524d53094e8181716e771c1023e968132abc15 It's obviously not my repo, but I need the changes that exist in that pull request. What is the best way to do this? wolfc To fetch a pull into your repository: git fetch git@github.com:jboss/jboss-common-beans.git refs/pull/4/head Then do whatever you want with FETCH_HEAD: git checkout -b new-branch FETCH_HEAD Steven Penny git pull origin pull/28/head Or git fetch origin pull/28/head

Git pull.rebase this is a possibly dangerous operation

不羁岁月 提交于 2019-11-26 20:38:24
问题 In the git-config documentation the information about pull.rebase: pull.rebase When true, rebase branches on top of the fetched branch, instead of merging the default branch from the default remote when "git pull" is run. See "branch..rebase" for setting this on a per-branch basis. NOTE: this is a possibly dangerous operation; do not use it unless you understand the implications (see git-rebase(1) for details). Could anybody describe in details what does "NOTE: this is a possibly dangerous

Git push only for bare repositories?

限于喜欢 提交于 2019-11-26 20:36:37
When I tried 'git push origin master' to remote repository on my external disk, git warning occured stating that pusing to checkout repository will in next releases of git refused by default. On external disk I have checkouted project and I want to send changes that I did on my computer to these reposiotry. Is 'git push origin master' not the right way? Do I have to 'git pull ...' on repository on my external disk? So I cannot push changes but just pull them? Only working with 'bare' repository is different? So if repository on my external disk was a bare repository I could push changes to it?