-
Notifications
You must be signed in to change notification settings - Fork 1
/
Day-1_Git_commands.txt
37 lines (19 loc) · 1.07 KB
/
Day-1_Git_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
To start using Git from your computer, you must enter your credentials to identify yourself as the author of your work. The username and email address should match the ones you use in Github.
git config --global user.name "your_username"
git config --global user.email "[email protected]"
To check the configuration, run :-
git config --global --list
1. To initialize an empty git repository in our local system (Local Repository):
git init
2. To add the file/files to that Local Repository:
git add [filename]
3. To commit the file:
git commit -m "committing the file"
git add and git commit go together hand in hand. They don't work when they aren't used together.
Local Repository is now ready.
Move to Github and create an empty Remote Repository there after which we get an auto-generated link.
4. To connect our Local Repository to our Remote Repository:
git remote add origin [link]
5. To push the Local Repository contents to our Remote Repository:
git push origin master
Remote Repository is now ready i.e. file/files will now be uploaded in out Github