Welcome to the repo where I keep notes on Git. I'm archiving git commands here to help you progress from zero to pro. I hope that will be useful.
echo "# git-commander" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:umutyerebakmaz/git-commander.git
git push -u origin main
git remote add origin git@github.com:umutyerebakmaz/git-commander.git
git branch -M main
git push -u origin main
- Checkout
git checkout --orphan latest_branch
- Add all the files
git add -A
- Commit the changes
git commit -m "first commit"
- Delete the branch
git branch -D main
- Rename the current branch to main
git branch -m main
- Finally, force update your repository
git push -f origin main
git branch -D `git branch --merged | grep -v \* | xargs`
or
git branch --merged | grep -v \* | xargs git branch -D
git branch -d local_branch_name
git checkout -b local-branch-name origin/remote-branch-name
$ git branch -r
origin/HEAD -> origin/main
origin/1132-umuts-branch
origin/main
$ git fetch origin 1132-umut-branch
$ git checkout 1132-umut-branch
git commit --amend
will open your editor, allowing you to change the commit message of the most recent commit. Additionally, you can set the commit message directly in the command line with:
git commit --amend -m "New commit message"
The MIT License (MIT). Please see License File for more information.