commit

How to delete the last n commit on Github and locally?

房东的猫 提交于 2019-12-04 07:23:41
问题 I'm trying to delete the last 2 commits in one of my GitHub repositories. I've tried as suggested here : git push -f origin HEAD^^:master. It seems that it works, the last two commits are removed. Then I deleted them from my local repository with git rebase -i HEAD~2. I remove the lines than are related with those commit, and check with git log that they are correctly removed. After that I make some changes in my local repository, make a new commit and push to GitHub. The problem is that in

What's the Git command to determine which commit changed a submodule pointer?

ぐ巨炮叔叔 提交于 2019-12-04 06:51:19
I'm dissecting a series of changes made to a git repo, some of which involved a submodule. I used git blame to find the relevant commit within the submodule, but is there a simple way to locate which commit in my main repo changed the submodule pointer to that commit? Cue simple diagram: 1 <- 2 <- 3 <- 4 <- 5 (Main chain of commits) | | | | | 1 1 1 2 2 (Submodule) I have located the commit where submodule #1 changed into submodule #2 (say it's 9d95812e...). How do I determine the fact that main-commit #4 is where the new submodule commit was first employed? From what I can tell this isn't

Grouping committed files together (as a single commit) after you've already committed them to the repository in Svn?

人盡茶涼 提交于 2019-12-04 04:40:10
问题 Is it possible to group a number of committed files together (as a single commit) after you've already committed them to the repository in Svn? It seems I always forget a file or two after I've committed a bunch them (when not using subeclipse) and I was just wondering if anyone knew if this was possible or not. 回答1: I find the best solution to use a higher level tool to group revisions together and track changes. We use redmine to document all tasks, and our svn revisions are automatically

How to remove deleted files from git?

半城伤御伤魂 提交于 2019-12-04 03:43:58
问题 I have committed and pushed a too large file in bitbucket, and I've deleted it locally, committed and pushed again. But on the site bitbucket the size of the repository is still too large. 回答1: Sounds like you created a new commit where you deleted the file. That means the file still exists in the previous commit. What you need to do is rewriting history . Assuming the two newest commits are deleting and adding that file, you can do the following: git reset --hard HEAD~2 git push --force This

Updating docker images with small changes using commits

守給你的承諾、 提交于 2019-12-04 02:57:51
I want to leverage caching/layering of docker images to save bandwidth, disk space, and time spent. Let say: I've a web-app docker image installed and deployed into several docker hosts. The docker image contains source code of my web app. I worked on the code, and now have a new version of the code. How should I automate the creation of a new docker commit above last image containing only the bugfix ? My goal is that only the small bugfix diff will be required to download to get the new images for docker hosts that already downloaded previous image. This is the sate of my current reflexion

how to apply a git patch as if the author committed to my repo?

谁说我不能喝 提交于 2019-12-04 01:58:28
Lets suppose there is a central repository where commits from satellite ones are pushed some time. Developer A makes some commits on his repo while B makes some on his own too. Now, A wants to incorporate one of B's commits into his repo (which he cannot access directly to pull). One way is to have B create a patch and send it to A but in that case there are two problems: 1. The patch will appear as local modifications to A who have then to commit it (with its own name) 2. Once the central repo is updated the changes will conflict (being pushed by two different authors). Is there a way to have

How grep through your staged files prior to committing?

你说的曾经没有我的故事 提交于 2019-12-04 01:29:14
So prior to running git commit I often will run the following: git grep --cached -l -I "debugger" I thought it was similar to: git diff --cached (which will show you all the changes you are about to commit, ie. will show you the diff in your staged files). Unfortunately, I just found that the --cached option for git grep simply tells git to "only" look at everything in its index. So how can I run git grep and have it only grep through my staged files? (Yes, I know I could simply do git diff --cached and search in that, but I would rather have the programmatic ability to grep through my staged

commit after select

跟風遠走 提交于 2019-12-04 00:14:37
I have read the explanations when a commit may be neccessary after a select statement for DB2 and MySQL: Is a commit needed on a select query in DB2? Should I commit after a single select My question is when and why would it be important to commit after executing a select statement using Oracle? If you did a SELECT ... FOR UPDATE; you would need a COMMIT or ROLLBACK to release the records held for update. Otherwise, I can't think of any reason to do this. there are only a few situations that I can think of that you may want to commit after a select. if your select is joining on database links,

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

Associating revisions with a Redmine issue

不想你离开。 提交于 2019-12-03 19:40:15
Is there a way to manually associate a revision/commit with a Redmine issue? Normally we do that by having a proper format of the commit message ("Resolves #..." in our case). But I forgot about it and used a different message. I have no rights to change the commit message now. And even if I would I still would not be able to delete Redmine's data for it to rebuild it again. (Method given in question Redmine and SVN: How to link a Revision to an Issue AFTER the commit has happened? ). I have updated the issue with "r..." comment which properly linked to the revision. But that is just a link.