Git command super abbreviated version

We have summarized the minimum commands for operating Git from a Linux (Ubuntu) terminal.

clone

git clone (URL)

Commit relationship

Basic repeat of this

git add .
git commit -m 'commit comment'
git push origin master #Update master branch

Cut the branch

git branch -a #List
git checkout (Branch name) #Move
git checkout -b feature #Create+Move (feature is an example)
git merge feature #Merge feature into master (only master)

If you use it so far, it seems that you can manage git at the individual level

(Bonus) I haven't used it much

git branch -d feature #Delete local branch
git branch -d -r origin/feature #Delete tracking branch
git push origin :feature #Delete remote branch by specifying an empty branch

git reset --soft HEAD^ #Undo last commit

The following may be helpful for reset https://qiita.com/ChaaaBooo/items/459d5417ff4cf815abce

Recommended Posts

Git command super abbreviated version
Docker command super abbreviated version
[Linux] Git command
CentOS version confirmation command