Delete the last commit, if it hasn't been pushed.
git reset --soft HEAD~1
Delete the last commit, if it has been pushed.
git reset --hard HEAD~1
git push origin HEAD --force
Temporarily ignore local changes to a file
Windows Registry Editor Version 5.00 | |
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder] | |
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder] |
##################### | |
# | |
# Use this with or without the .gitattributes snippet with this Gist | |
# create a fixle.sh file, paste this in and run it. | |
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF) | |
# This Gist normalizes handling by forcing everything to use Unix style. | |
##################### | |
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF |
Delete the last commit, if it hasn't been pushed.
git reset --soft HEAD~1
Delete the last commit, if it has been pushed.
git reset --hard HEAD~1
git push origin HEAD --force
Temporarily ignore local changes to a file
#add 'node_modules' to .gitignore file | |
git rm -r --cached node_modules | |
git commit -m 'Remove the now ignored directory node_modules' | |
git push origin master |
If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.
Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.
If in doubt about what git is doing when you run these commands, just
'use strict'; | |
/** | |
* Follow these steps to configure the webhook in Slack: | |
* | |
* 1. Navigate to https://<your-team-domain>.slack.com/services/new | |
* | |
* 2. Search for and select "Incoming WebHooks". | |
* | |
* 3. Choose the default channel where messages will be sent and click "Add Incoming WebHooks Integration". |
{ | |
"extends": ["airbnb", "prettier"], | |
"plugins": ["prettier"], | |
"rules": { | |
"prettier/prettier": ["error"], | |
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], | |
"react/destructuring-assignment": ["always", { "ignoreClassFields": true }] | |
}, | |
"parser": "babel-eslint" | |
} |
function test() { | |
console.log('test'); | |
}; |
<> | |
<div className="App"> | |
<Container> | |
<Header /> | |
</Container> | |
</div> | |
<Jumbotron> | |
<Container> | |
<Row className="justify-content-center"> | |
<Col md={6}> |