# 6.Monday, 22-07-2019 - GIT ### Lambda ### GIT #### Local * **git add** Put a file onto Staging >git add test.txt > >git add . * **git commit** Commit a file after put it onto Staging >git commit -m "Message" > * **git status** Check status of file in Staging >git status > * **git log** To have a look on versions of source >git log > * **git reset** Put source back to Staging >git reset 32fghjj > * **git checkout** Roll back source at the specific time >git checkout test.txt > We can use checkout for change branch >git checkout branch_name * **git branch** Create a new branch >git branch nicky > * **git rebase** We would like to move our work from branch1 directly onto the work from branch2. >git rebase branch2 Force a branch to specific point >git branch -f branch_nicky HEAD~1 >git branch -f branch_nicky C4 > * **git merge** Combine 2 or more branchs to be one >git merge master * **git reset** Back to last step and remove the current step >git reset HEAD~1 * **git revert** Use it when we have more users work in same source. Keep the current step and move to next step >git revert HEAD #### Remote * **git clone** Synchronize source local and remote >git clone * **git fetch** git fetch performs two main steps, and two main steps only. It: * downloads the commits that the remote has but are missing from our local repository. * updates where our remote branches point. * **git pull** Pull source from remote to local git pull = git fetch + git merge >git pull * **git push** Push source from local to remote * **git fakeTeamwork** Create a fake teamwork and move to n step >git fakeTeamwork master 2