-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgit basics
More file actions
57 lines (39 loc) · 1.71 KB
/
git basics
File metadata and controls
57 lines (39 loc) · 1.71 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# config
-git config --global user.name "Sohel Rana"
-git config --global user.name "sohelcuetcse11@gmail.com"
-git config --global core.editor "code --wait" //default code editor
-git config --global -e //open config file in the default code editor
--command--
git branch
git branch -r -- all branch show
git remote -v --show origin
To show users from all branches (not only the ones in the current branch) you have to add --all flag:
git shortlog -sne --all
git commit --amend -m "merge this code to last commit"
git checkout - (go previous branch)
git checkout -- (clear all uncommit code)
git checkout -b newBranch
git branch -D branchName
git diff
stash - temporary save
git stash save "some change"
git stash list --(view all stash)
git stash apply --(go back to last unfinished work)
git stash apply stash@{1} --get specific stash
git stash drop stash@{1} -- remove specific stash
git stash pop -- remove lastes
reset (hard, soft, mixed)(only do if you don't push you code.| only your local working directory)
git reset --hard (logHashID) goto this commit
cherry-pick, revert (specific commit code back)
git cherry-pick logHash --- get specific code
git revert logHash --undo/reverse a specific commit
--conflicts--
git checkout --theirs-- . --keep server code
git checkout --ours-- . -- keep my code
keep from both, do manually
rebasing - history changed
in feature branch if you want to get latest code from master
git rebase master ==> from master to feature || it will updated all updated master code to feature branch
git rebase feature ==> from feature to master
tag, release -
https://docs.google.com/presentation/d/19kE079Aut6SqVbNQq7QcJjOh0uyNHPpYki3uFGPjlxY/edit#slide=id.g4451636dee_1_18