forked from avamsykiran/GitDemoRepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
115 lines (59 loc) · 3.11 KB
/
notes.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
Git
----------------------------------------
SVN tool
Source code version control tool.
Workspace
Git Locala Repo
Remote Repo github.com
git cmds
--------------------------------------------------------------
git --version
git init
git config --list
git config --global key value
git config --global user.name "Aripaka Vamsy Kiran"
git config --global user.email "[email protected]"
git remote add remoteRepoName remoteRepoUrl
git remote add origin https://github.com/avamsykiran/GitDemoRepo.git
git add files
adds file from workspace to local repo --------> Staging
git status
give the status of the staging area .
git commit -m "message"
is going commit the changes made to the files
in staging area. It is mandate to commit the
chagnes before you push the fiels to the remote repo.
git log
is going list out all the commits
git push origin master
git clone https://github.com/avamsykiran/GitDemoRepo.git
git restore file
cancel the recent chagnes made to file until recent commit.
it removes all uncommited chagnes.
git pull
is nothing but a differetial clone.
git show commitId
will display the details of a commit.
git diff
will display the changwes made.
Versioning
-----------------------------------------------------------------
git log gives the lsit of commits
git log --oneline gives the lsit of commits in brief
git show commitId shows the chagnes in a specific commit.
git checkout commitId . switch the workspace and local repo a specific commit
git switch - will make the head point to the latest commit.
Branches
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
a branch is a parelell copy of our repo.
a repo can lie on a single branch at a time.
we can switch between branches freely.
git branch
git branch branchName ---> add a new branch
git checkout branchName ---> will swithc from current branch tot he one specified
git checkout -b newBranchName --> will add and swithc tot heat branch.
git merge branchName ---> the current brach will be merged with the specified branch
git branch -d branchName ----> Removes a branch only if its merged already
git branch -D branchName ----> Removes a branch by force
git push origin --delete branchName ---> Remove a branch from remote repo.
git branch -m oldBranchName newBranchName ----> renames a branch