-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit_imp_commands.txt
39 lines (31 loc) · 1.61 KB
/
git_imp_commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
git log (list of all the version commits in the folder)
git log --stat (additional statistics regarding file changes)
git --version (check version of git that you have installed)
git clone "URL" of repository - clone the repo
git diff first_id second_id (diff between 2 commmits)
git config --global color.ui auto (view colored line indications)
git checkout commit_id
ls -a (view hidden files)
git add file_name - add a file to the staging/intermediate area
git status - tells you which files were modified since the last commit
git diff - diff between the staging area and the working directory
git diff --status - diff between the staging area and the repository
git reset --hard - reset changes in the working directory and the staging area
git checkout master (come out of detached HEAD state)
git branch (shows you all the current branches)
git branch new_branch_name - create a new branch
git checkout branch_name - checkout that branch
git log --graph --oneline branch_names (visualize branches)
git checkout -b new_branch_name
git merge branch_1 branch_2 - merge 2 branches
git show commit_id - show the difference between commit and it's parent only
git branch -d coins - delete branch
git log -n 1 - show only 1 commit
git remote -v - list of remote repos
git remote add origin "link to github repo location on your github"
git pull origin master - pull the master branch from github to the working directory
git push origin master (local -> github)
git fetch origin - update all the local copies of every branch for the origin remote
git log origin/master
git merge origin master
rm -rf .git (removed git from a directory)