git-commit

GIT Pull deleted my commit

荒凉一梦 提交于 2019-12-06 04:54:44
问题 After git pull I have done git reset hard to undo the merge with commit id before merge.Somehow my entire commit is gone and I cant the see the commit in history also. But I have the commit id , on git show command I can see my changes. How can I get back my changes and how to track what mistake I have done 回答1: if you have the commit hash, and you have not run garbage collection, you can always go back to that commit with git checkout <sha1> . if you want to re-apply it on top of your

Is there a way to rebase and squash commits on Gitlab CE UI?

╄→尐↘猪︶ㄣ 提交于 2019-12-06 04:13:28
问题 Is there a way to rebase and squash commits on Gitlab CE UI, instead of using the interactive mode through command-line? 回答1: It seems implemented in issue EE 150 to the EE PR 1024, for allowing squashing merge request (GitLab EE 8.17). See the documentation (EE for now) "Squash and merge". The CE issue 4106 advocates for that feature to migrate back to CE. Update Feb. 2018, a year later: as Jürgen Steinblock adds in the comments: Great news! It looks like this will make it into 10.8: see

Unable to Publish from Github Desktop Application to github.com

情到浓时终转凉″ 提交于 2019-12-06 04:13:01
While trying to publish from Github desktop app to github.com am getting the following error. GitHub Desktop was unable to store the account token in the keychain. Please check you have unlocked access to the 'login' keychain. relogin didnt help. Updating Github desktop didn't help. Deleted all the entries regarding github in Keychain tool This seems to be caused by the Keychain being in an invalid state, affecting applications that try to use the keychain to store or retrieve credentials. Seems to be specific to macOS High Sierra and Mojave. Workaround: Open Keychain Access.app Right-click on

Removing subproject commit from github

这一生的挚爱 提交于 2019-12-06 02:43:53
I have two repositories namely A and B . By mistake I cloned repo B inside A on my machine. I removed all the code from the repo B but when I pushed and merged my code from A on origin, it also shows a subproject commit B on Github repo. I want to remove the subproject commit from my master on origin. Will these steps work? 1. rmdir B (on my local repo A) 2. Pushing my repo A to origin 3. Merging VonC Since GitHub displays B as a gray folder within A repo, that means B has been added to A as a submodule. That gray folder is a gitlink , a special entry in the index . See " How do I remove a Git

Can git filter out certain lines before commit?

我只是一个虾纸丫 提交于 2019-12-05 23:10:05
I have a repo on github that I am working out of and I often have comments on my .py files that starts with the " # TODO: " to keep a personal note of things to be done. # TODO: do this <code> I obviously do not want that to go in a commit. I want GitHub to search all the files when I am about to commit them and not include lines that start with # TODO: Does Git already do this? I know certain version control like perforce already have this feature. Any thoughts? VonC I want GitHub to search all the files when I am about to commit them and not include lines that start with # TODO: GitHub

Jenkins Invalid Git Revisions

北战南征 提交于 2019-12-05 20:57:35
In Jenkins I'm using the XML API to get the SHA(s) of a commit, e.g. http://jenkins/view/job/test/470/api/xml?xpath=//lastBuiltRevision/SHA1&wrapper=SHAS I put it in a wrapper because often it contains more than one SHA and I'm going to process these further. However one of the SHAs always is invalid... <SHAS> <SHA1>cbf26ebac6b4b3860a794c0b1ad86758e7757a3a</SHA1> <SHA1>7e861132ce428911585a818107ba35c44cf12bbf</SHA1> </SHAS> The second SHA is fine but when I check the first SHA here on our GIT repo commits it leads to an error page: Commit 'cbf26ebac6b4b3860a794c0b1ad86758e7757a3a' does not

Show diff when writing commit messages during an interactive rebase

大憨熊 提交于 2019-12-05 18:04:05
问题 When doing a regular git commit, git commit --verbose shows the diff in the text editor when writing the commit message. Suppose I am doing an interactive rebase ( git rebase --interactive ) to edit previous commits. To 'continue' rebasing, I run git rebase --continue . This opens a text editor for editing the commit message, but it does not show the diff. After making changes to a commit, how can I display the diff when (re)writing the commit message during an interactive rebase? git rebase

What problem or threat does commit signing solve? [closed]

帅比萌擦擦* 提交于 2019-12-05 17:02:51
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . We use GitHub and we have a request to perform commit signing. After studying the process, it's not clear to me what problem commit signing solves. As I understand the process, there's "local source code" that gets committed to a "local repo" that gets pushed to a "remote repo" .

Go back N commits in Git to find commit that causes test regressions

╄→гoц情女王★ 提交于 2019-12-05 13:24:23
问题 Is there a command that will let me checkout a commit based on its distance from the current commit instead of using commit IDs? Use Case Basically I am thinking of setting up a cron job type script to do the following on a build server: Pull down the latest of a specific git branch (git pull dev). Build it, run the tests. If the pass percentage is lower than the last stored percentage: Recursively go back a commit, build, run tests, until it finds the commit where the percentage changed. Log

How can I list all modified files by an author between a commit range but only with the last thing that happened to the file in Git?

心不动则不痛 提交于 2019-12-05 12:40:35
The command: git log --oneline --name-status --author=$AUTHOR $COMMIT_RANGE | grep -vE '[a-fA-F0-9]{5} ' | sort | uniq | cat -n Returns a list of the files modified by an author between a range of commits with the status e.g. M for modified. 1 M a_file 2 M another_file 3 M file 4 D file How can I show only the last thing that happened to the file file , e.g. here it was deleted ( D )? I don't want to see the previous modifications to the file (i.e. the M ), only the last thing that happened in that range of commits. Thanks for the attention! You can tweak uniq to look only at a certain field: