Difference between revisions of "Git"
From zen2
| Line 9: | Line 9: | ||
==Pull from repo== | ==Pull from repo== | ||
*git pull | *git pull | ||
| + | |||
| + | |||
| + | ==Remove from git== | ||
| + | eg p/w file | ||
| + | |||
| + | *git rm myConfigFile | ||
| + | *echo myConfigFile > .gitignore | ||
| + | *git add .gitignore | ||
| + | *git commit -m "from now on, no more myConfigFile" | ||
| + | |||
| + | The other extreme approach (dangerous especially if you have already pushed your repo to a remote one) would be to entirely remove that file from the history of said repo: | ||
| + | |||
| + | *git filter-branch --index-filter 'git update-index --remove myConfigFile' HEAD | ||
Revision as of 01:48, 19 July 2016
Add changes and upload to repo
- git add -u
- git add .
- git status
- git commit -m "A description of changes"
- git push
Pull from repo
- git pull
Remove from git
eg p/w file
- git rm myConfigFile
- echo myConfigFile > .gitignore
- git add .gitignore
- git commit -m "from now on, no more myConfigFile"
The other extreme approach (dangerous especially if you have already pushed your repo to a remote one) would be to entirely remove that file from the history of said repo:
- git filter-branch --index-filter 'git update-index --remove myConfigFile' HEAD
