-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGithub
66 lines (36 loc) · 1.58 KB
/
Github
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
GITHUB
Install : sudo apt install git -y
Then create account on Github
My username : GibJaf
Password : It is on my mobile
Each account can have multiple repositories
git --version => prints git version installed
Configuration : git config --global user.name "<UserName>"
git config --global user.email "<Email_Registered_On_GitHib>"
git config --list => lists current config details
Same config details in file : ~/.gitconfig
METHOD 1
Cloning : git clone <URL of repository>
Now make whatever changes to contents of that repository
git status => prints status , comparing online git repo and changes made to this
downloaded repo.
git add <file_name>
git commit -m "Comment" <file_name> <= doesn't mean that it has been pushed onto online repo
git push -u origin master
Then it asks for username and password
Type them in the changes will be reflected in online repo
METHOD 2
1) Install hub by cloning it as 'git clone https://github.com/github/hub.git'
2) Create remote github repository :
3) hub create <repository_name>
Notes:
1) If file is being deleted , then to stage the deletion
do => git rm <file_name>
If it is a folder to be deleted then do
=> git rm -r <folder_name> . All files in it will
will also be removed
Then go ahead and commit the change and push it to github.com
2) In order to discard all local commits on this branch,
to make the local branch identical to the "upstream"
of this branch, simply run
=> git reset --hard @{u}