git-pull

why git stash cannot abandon the changes made just now?

好久不见. 提交于 2019-12-04 02:54:09
问题 i forked a project from github, and the origin point to my own github repo, remote point to its original repo, since i want to get update from remote, i use git pull remote branch_name, then my local repo is in conflict mode, now i want to cancel the effect of git pull, so i use git stash, but was surprised to find i failed to do this? what's wrong? the detailed info is as follows: [mirror@home weechat]$ git status # On branch master # Unmerged paths: # (use "git add/rm <file>..." as

Git says local branch is ahead of remote after having pulled from remote

亡梦爱人 提交于 2019-12-03 23:00:57
I’m sorry if the title isn’t clear, but this is a weird problem. I git checkout to my "stage" branch and git pull to get my partner’s latest changes (which he pushed last night to the "stage" branch on the remote repository), and sure enough, they merge to my local "stage" branch. git log <branch> shows five commits he performed last night. I then switch over to the master branch to pull that from the repo because he told me he merged those changes to the master branch after testing them. But when I git checkout stage to get back to my "stage" branch it says I’m ahead of the remote branch by 5

How to pull into not-the-current-branch?

蹲街弑〆低调 提交于 2019-12-03 22:04:17
Say my current branch is myfeature. I want to get master up to date. Both git merge git pull always merge into the current branch, as far as I can tell. Is there a way to merge changes from a remote branch (eg, origin/master) into a branch I'm not currently on (master)? I can think of one way: git stash git checkout master git pull origin/master git checkout myfeature git stash apply Is there a better one? (It's possibly my whole question is wrong: would git fetch automatically update master to match origin/master, if remote-tracking is enabled?) You are correct that pull/merge only merges

GIT: `error: unable to find <commit>` and `fatal: object <commit> not found` on pull

杀马特。学长 韩版系。学妹 提交于 2019-12-03 21:43:37
We have a repo in Bitbucket, which we use as a central repo: we update it via pull requests or directly by pushing changes, and we synchronize the last changes in remote servers by pulling from it. This has been working like a charm for about a year, but now we are not able to pull changes from this repo to update a remote server: $ git pull origin remote: Total 0 (delta 0), reused 0 (delta 0) error: unable to find a1354e341c6773997c31a109e615d1bf9acb0119 fatal: object a1354e341c6773997c31a109e615d1bf9acb0119 not found Nonetheless, this object/commit is available from Bitbucket and also in my

How to rebase only the commits after the latest merge?

旧巷老猫 提交于 2019-12-03 21:18:50
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 from 3. It's not what I want. There is also option to do git merge master , then git rebase -i -p

How to push/pull Git rebase

匆匆过客 提交于 2019-12-03 19:05:27
问题 I'd like to use git rebase so as to cleanly merge a feature in the master branch (in less commits or at least at the top of the change log). Note that I'm the only one working on the repository . After reading Git workflow and rebase vs merge questions, I found git rebase would be pretty nice and like Micah I'd like to git push rebased changes simply because I'm working on them from different places (ex: my notebook, my home, another PC somewhere...) So here are two solutions (to the bi

How to configure “git pull --ff-only” and “git merge --no-ff”

不想你离开。 提交于 2019-12-03 15:16:09
问题 A typical git workflow for me is to clone a remote repository and use git pull to keep it up-to-date. I don't want merge commits when I pull, so i use the --ff-only option. I also make local branches for feature work. I want to preserve the branch history, so when I merge the local branch back to my local clone, I use the --no-ff option. How can I configure git to use those options by default? Currently my .gitconfig looks like this: [merge] ff = false [pull] ff = only However, git pull

Git fetch and pull with no arguments

走远了吗. 提交于 2019-12-03 11:29:38
问题 I have a git branch checked out named foo . > git status # On branch foo nothing to commit (working directory clean) It was originally checked out using this command: > git checkout origin/foo -b foo --track I want to get updates to this branch from the remote repository. I know that either of these commands will suffice: > git fetch origin foo # ignore the lack of merging > git pull origin foo If I omit the arguments to fetch or pull , will git default to fetching (or pulling) the branch

Avoid recompilation with git and make

时间秒杀一切 提交于 2019-12-03 10:57:33
问题 I have two development branches in git and I frequently need to change between the two. However, the really frustrating thing is that every time I change branches in git, the entire project gets rebuilt because the file-system timestamps for some files will change. Ofc, the makefiles are configured to build the project into two different build directories . Is there any way around this? Compilation is a very long and time-consuming process... Edit:- This is a slightly more detailed

What are these symbols next to “merge mode by recursive” in git merge?

て烟熏妆下的殇ゞ 提交于 2019-12-03 10:42:03
When I use git pull [project name] master to update my core files, I get a bunch of green plus and red minus signals under "merge made by recursive." What are these symbols and what do they mean? Here's a screenshot: Thank you for your help. That is an approximation of how many lines have changed. Pluses are for new content and minuses are for what was taken out. Modifications end up with equal amount of both. Deletions are only minuses and new files are all pluses. Hope this helps! 来源: https://stackoverflow.com/questions/7616742/what-are-these-symbols-next-to-merge-mode-by-recursive-in-git