#GIT COMMANDS:
- git fetch origin
- git reset --hard origin/master
- git checkout master
- init: git init
- add all: git add -A
- commit all: git commit -am „commit message“
- rename last commit: git commit --amend
- rm -rf .git
- git init
- create diff: git diff origin/branchname > changes.patch
- ggf reset branch: git reset --hard origin/branchname
- apply diff: git apply changes.patch
- switch to branch: git checkout „feature_branch“
- create and switch to branch: git checkout -b „feature_branch“
- show remote branches: git branch -r
- To delete a local branch: git branch -d feature_branch
- To delete a remote branch: git push origin :feature_branch
- To show remote branches: git remote show origin
- git checkout „master“
- git pull
- git checkout „feature_branch“
- git rebase master
- git checkout master
- git merge - - ff-only feature_branch
- git tag -d 12345
- git push origin :12345
- git tag 12345
- To push a single tag:
- git push origin <tag_name>
- And the following command should push all tags (not recommended):
- git push --tags
- (optional) seine Änderungen backupen auf neuen branch git checkout -b
- git reset --hard 378b312 (wo 378b312 die SH1 eines anderen commits spezieller: tag/branch/commit id) —> http://stackoverflow.com/questions/1616957/how-do-you-roll-back-reset-a-git-repository-to-a-particular-commit
- git remote update origin --prune
git branch | grep -v "master" | grep -v ^* | xargs git branch -D
- git revert e793a613a06aeacac2d784616b849bca0b8f9a95 (if last thats the most upper commit)
- mvn versions:set -DnewVersion=1.1.22
-
git remote set-url origin ssh://[email protected]:7999/java/cloudportal.git
-
Git rarere feature enable: git config --global rerere.enabled true more about: https://git-scm.com/blog/2010/03/08/rerere.html
- Fork their repo on Github
- In your local, add a new remote to your fork; then fetch it, and push your changes up to it
- git remote add my-fork [email protected]
- git fetch my-fork
- git push my-fork
I. echo "# notes" >> README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/Macilias/notes.git git push -u origin master
II. git remote add origin https://github.com/Macilias/notes.git git push -u origin master