git init this command initializes the repository.git init
git add this command adds file/files to the repository.git add file_name.ex...
For further actions, you may consider blocking this person and/or reporting abuse
Here are more practical ones(IMHO):
Change the last commit message
git commit --amendRevert last unpushed commit
git reset HEAD~1 --softShow log one line
git log --onelinePress q to exit
Delete a local branch
git branch -d <BRANCH NAME>Ignore push and merge status and force delete:
git branch -D <BRANCH NAME>Delete a remote branch
git push <REPOSITORY REF> --delete <BRANCH NAME>example:
git push origin --delete beta-1.0.0If branch ref is equal to a tag ref:
git push <REPOSTIORY REF> :refs/heads/<BRANCH NAME>example:
git push origin :refs/heads/beta-1.0.0And
git checkout -b <new-branch-name>ty!
And
git log --all --graph --onelinegit status -sGreat list, if I was to add one:
git cherry-pick [commit id here]incredibly useful to pick specific commits when you don't want the branch.It is always better to use
git checkout [commit id here || branch name] [filename of other branch]than cherry pickNot always better. They work differently:
cherry-pickwill append the specified commit to the current one.checkoutwill bring the specified commit's changes to the working directory (it's up to you to commit those changes).It really depends on what you want to do. I use both frequently.
thank you
git remote add <remote-name> <remote-url>Add remote to project
git remote rename <old-remote-name> <new-remote-name>Rename project remote
git remote rm <remote-name>Delete remote from project
Something related to
git remotewhich helps in changing the existing remote URL for a remote.Yes, forgot this one
Thank you very much 🙏
great
I find this extremely useful a lot of times
git reflogShows the history of the local HEAD. Useful when you lost some local code recently
I must sincerely say that I find this write up helpful. Thank you all