git-commit

I “reverted a commit” and lost days of progress. How do I get my progress back?

两盒软妹~` 提交于 2019-12-08 11:35:22
问题 In Github Desktop I tried to commit and sync progress (like the fool I am, the last time I sent a commit was 4 days ago). I got an error message saying something like the push didn't succeed because one of the files exceeded 100MB (I am looking into adding this file to .gitignore). I checked my github account online to see if any of the files got pushed and none did. I checked on Github Desktop and couldn't see any of the files. I thought to myself this isn't good because if it's not

how to change the visual code studio commit authors

天大地大妈咪最大 提交于 2019-12-08 07:36:03
问题 I am not sure why, but my Visual Studio Code is showing the wrong commit author name. I am trying to change the author of the commit. How can I do that? I have already multiple things, but no luck. This is what I tried: Since I have three commits, I tried git rebase -i HEAD~3 , but I am getting this error: Cannot rebase: You have unstaged changes. Please commit or stash them. I am able to get to this now, how can i change the author name now? 回答1: For the issue: Cannot rebase: You have

Does GIT does the CRLF/LF conversion during commit or checkout(vi)?

前提是你 提交于 2019-12-08 03:08:20
问题 I have a doubt now, does Git does the CRLF conversion during a commit or during a vi of the file? Let’s say I have some files in Windows with CRLF (not a Git repo), when I sync these files to a UNIX Git repo and do git add/commit with autocrlf true enabled, will these files get the conversion from CRLF to LF? Or does it do the conversion of these files only when I vi these files and commit it again? The second doubt is, what should be the autocrlf and safecrlf setting in both Unix and Windows

Is it possible to set a git commit to have a timestamp prior to 1970?

十年热恋 提交于 2019-12-08 02:43:19
问题 Unix timestamps are signed 32 bit integers (64 bit on some systems today, or so I understand). On some software products this allows you to use dates going back as far as 1903 or so. However, when I try the following: git commit -m "this is a test commit" --date="1960-04-07 18:00:00" I receive an "fatal: invalid date format" error. This isn't very practical (I'm not a time-traveler), but I've been wondering about using git for historical purposes. Can this be forced with a git plumbing

Unable to Publish from Github Desktop Application to github.com

泪湿孤枕 提交于 2019-12-07 18:36:57
问题 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 回答1: 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

Removing subproject commit from github

女生的网名这么多〃 提交于 2019-12-07 17:55:37
问题 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 回答1: Since GitHub displays B as a gray folder within A repo, that means B has been added to A as

Jenkins Invalid Git Revisions

坚强是说给别人听的谎言 提交于 2019-12-07 13:02:53
问题 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

Custom Git Commit Message Template

倖福魔咒の 提交于 2019-12-07 04:47:13
问题 How do I craft customized commit message template? I would like to have something like: # Short (50 chars or fewer) summary of changes # More detailed explanatory text 回答1: Add following to your ~/.gitconfig : [commit] template = ~/.git-commit-message Create ~/.git-commit-message file with following content: # Short (50 chars or fewer) summary of changes # More detailed explanatory text Ref. commit.template in http://git-scm.com/docs/git-config 来源: https://stackoverflow.com/questions/31873577

Does GIT does the CRLF/LF conversion during commit or checkout(vi)?

。_饼干妹妹 提交于 2019-12-06 13:41:17
I have a doubt now, does Git does the CRLF conversion during a commit or during a vi of the file? Let’s say I have some files in Windows with CRLF (not a Git repo), when I sync these files to a UNIX Git repo and do git add/commit with autocrlf true enabled, will these files get the conversion from CRLF to LF? Or does it do the conversion of these files only when I vi these files and commit it again? The second doubt is, what should be the autocrlf and safecrlf setting in both Unix and Windows Git clones if my parent repository exists in Unix and need LF alone. Should I use global setting?

How to exclude a commit from git pull request?

浪尽此生 提交于 2019-12-06 08:05:13
问题 I have made a git pull request with my repo. Sometime later, before pull request got approved, I proceeded to make another commit&push which also got pushed up to pull request. Is there a way to remove the last commit from pull request and how to prevent this from happening in the future? 回答1: Yes, you simply can reset your branch to the previous commit, and force push: the pull request will be automatically updated. git checkout yourBranch git reset --hard yourBranch~ git push --force origin