Here you ll find the top most usefull git commands explained in details with examples.
Chapters :
00:00 Intro
00:15 git config
00:40 git init and git clone
01:50 git status
02:08 Understanding git workflow
03:03 git add and git commit
04:55 git log
05:08 combine git add & commit in single command
06:44 git push
07:20 git branch
08:27 git checkout / switch
10:08 git pull
10:55 git fetch
12:10 git merge
Used commands :
► Git config to configure email and name appearing in commits :
git config --global user.email "your_email_address@example.com"
git config --global user.name "MyName"
► Git init to initialize a local repo from scratch :
git init mynewproject
► Git clone an existing repo :
git clone ssh://[...]
► Git status to check current repo :
git status
► Clone remote repository :
git clone ssh://...
► Add all local changes (and untracked files) to staging area :
git add .
► Add all local changes except untracked files to staging commit :
git add -u
► Commit file locally :
git commit -m "Your commit message"
► Combine git add and commit :
git commit -am "Your commit message"
► Update message from latest unpushed commit :
git commit --amend
► List branches :
git branch
► Create new branch :
git branch -c NEW_BRANCH
► Switch to branch :
git checkout NEW_BRANCH
git switch NEW_BRANCH
► Create and switch to new branch :
git checkout -b NEW_BRANCH
git switch -c NEW_BRANCH
► Push commits to remote repository:
git push
► Git log to check commits history :
git log
► Git fetch to retrieve remote changes without applying them :
git fetch
► Git merge to merge two branches (like remote and local), first switch to the branch you want to merge then :
git merge [BRANCH TO MERGE]
► Git pull to fetch and merge remote changes locally :
git pull
#gitcommands #git #gitexamples
Icons made by [ Ссылка ]
Ещё видео!