-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit_lecture.txt
51 lines (35 loc) · 1.68 KB
/
git_lecture.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
D: --> To select the "D" drive
mkdir Ashik --> Create a file inside the "D" drive named "Ashik"
cd Ashik --> Change Directory to exactly "Ashik" folder
git init --> Init local Git inside the "Ashik" folder
git status
notepad file1.txt --> create a notepad file named "File1.txt"
git add . --> Add all the files in the "Staging Area"
file1.txt --> Open "file1.txt" and can customize
git restore file1.txt --> Can restore to the previous file
git commit -m "First update" --> Make the Comment to store into "Local Repository". Always do it to push on "GitHub"
*******Open a "Repository" in Github*******
--> Run the following command to push pudate from Local repository to GitHub <--
git branch -M main
git remote add origin https://github.com/racashik/bitmsqa4.git --> Add Repository url
git push -u origin main --> Everytime use this command to Push the update into GitHub
******** Share own repository with other
--> Go to the repository file
--> Settings
--> Collaborators
--> add email/user name to send invitation
******* Clone / Pull others repository ************
--> Go to the client's repository
--> go to clone
--> Copy the HTTPS URL
--> from CMD select the directory
--> git clone "HTTPS URL"
******* Create new branch ***********
git branch --> check present branch
git branch dev --> Cheate a new branch named "dev"
git checkout master --> switch to the "Master" / "Main" branch
git checkout dev --> switch to the "dev" branch
notepad dev.txt --> creat a new file inside the dev branch
git add .
git commit -m "Dev update"
git push --set-upstream origin dev --> Use to push the dev branch on Github