git-pull

How do I use the --work-tree option with git? I keep getting an error

∥☆過路亽.° 提交于 2019-12-09 16:14:12
问题 I have a normal repo where there is a working tree and a .git folder in the same directory as the working tree. I'm trying to run a git command from outside this location with the command git --git-dir=/path/to/repo/.git --work-tree=/path/to/repo pull /some/other/repo master but I keep getting the error fatal: /usr/libexec/git-core/git-pull cannot be used without a working tree. . What am I doing wrong? 回答1: This is a bug in earlier versions of Git. This problem should go away once you

How to rebase only the commits after the latest merge?

隐身守侯 提交于 2019-12-09 13:48:08
问题 Consider following scenario: I checked out a branch from master I made some commits I merged updated master I made some more commits Now I want rebase commits from point 4 so that commits from point 2 are not affected. So if I have initially: (1) (2) x--x--x--x--x--x--x master \ \ y--y--Y--y--y dev (2)(3) (4) I want to get: (1) (2) x--x--x--x--x--x--x master \ \ y--y--------Y'--y'--y' dev (2) (5) (5) If I just do git rebase master it will rebase commits both from 2 and from 4 and delete merge

shell_exec and git pull

随声附和 提交于 2019-12-09 07:22:40
问题 I was hoping someone could help, I have a PHP page which uses shell_exec to zip up a directory and run git pull to bring down recent repository changes. $op = shell_exec("cd /home/user/git/$repo/$dir/; zip -r /home/user/archives/$dir.$datestamp.zip $dir; cd /home/user/git/$repo/$dir/; git pull"); The zip works fine. If I change git pull to for example git log or git status - within my shell_exec, this works also, and I can see the log file. Just doesn't seem to like git pull. I saw another

Why do I see a deleted remote branch?

会有一股神秘感。 提交于 2019-12-08 15:04:24
问题 I have a remote repository and 2 clones. I create a branch in one of the clones e.g. test . I do some work and 2 commits. I merge to master branch and push -u the branch. I do a git pull in the other clone. I see both master and test . In the first clone project I do: git origin :test to delete test branch on remote repository. test is deleted on remote repos. I do git branch -D test and the test branch is deleted locally as well. If I do git branch -a I get: *master remotes/origin/master Now

will fetch/merge not work if files are added or deleted in GitHub repository?

血红的双手。 提交于 2019-12-08 11:19:40
问题 I made two changes to my remote repository in GitHub , by adding a new file and deleting a old file (by using the Web interface of GitHub ). when I do : git fetch origin master remote: Counting objects: 6, done. remote: Compressing objects: 100% (4/4), done. remote: Total 5 (delta 2), reused 0 (delta 0) Unpacking objects: 100% (5/5), done. From github.com:TommyHilly/programFiles * branch master -> FETCH_HEAD git merge origin/master Already up-to-date. whenever new files are added or deleted,

how to request pull request from a particular remote in git?

本秂侑毒 提交于 2019-12-08 09:48:38
问题 This is how my config file of git looks: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true precomposeunicode = false [remote "origin"] url = git@github.com:XXXXXXX/training.test.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master [remote "upstream"] url = https://github.com/YYYYYYY/training.test.git fetch = +refs/heads/*:refs/remotes/upstream/* The remote "origin" points to my

How to make my local git copy always at its latest version automatically?

自闭症网瘾萝莉.ら 提交于 2019-12-08 08:32:07
问题 My system has few git repositories with some c++ code in them. Users which send a request to my system are getting a binary executable compiled from all the git repositories together. A basic feature of this system is to send binary built from the latest version of the source. In order to do so, each time the system gets a request it runs git pull --all , this command takes a lot of time. I want to avoid running the pull command when a request arrives and instead to make the system run the

EGit: Issuing a fast-forward pull ~ How to configure fetch for a remote repository in EGit

China☆狼群 提交于 2019-12-08 07:44:45
问题 So let me set up my scenario. I am using EGit 4.1.1 in Spring Tool Suite (Eclipse 4.5.1). My tech-savvy coworker and I have cloned the same git repository from a remote URL. My tech-savvy coworker, who prefers the command line, does his file modification using VIM, then issues the commands git add . git commit -m "Modified file" git push Now the change is in the remote repository. Now I, who am less CLI-prone and more prefer the GUI, am using EGit in Eclipse. To receive the change, I right

Git Merge branch 'master' of https://bitbucket.org/xxx/yyy

假装没事ソ 提交于 2019-12-08 07:33:07
问题 We have come to git after using SVN for years and at times, I must admit, it is confusing. Take the following example - User1 makes a change to a.java and pushes to the remote server. User2 makes a change to b.java. He can't push straight away (a deviation from SVN but that is OK). He needs to first pull from remote server, and then push his change to the remote server. This would be shown as a separate merge commit and has been beautifully explained in here on stackoverflow itself Now is the

git pull with “--work-tree” flag fails

北战南征 提交于 2019-12-08 05:33:59
问题 I'm running (in a script - trying to avoid using cd): git --git-dir=/test/.git --work-tree=/test/ pull And getting: fatal: /usr/lib/git-core/git-pull cannot be used without a working tree. Note that I've run other commands with exactly this structure that have worked (in particular, add, commit, and pull), so I think it's just a pull problem. A similar problem is documented here: Git pull fails to parse syntax, but it's not quite the same - they get a different error (and they're running on