Repository navigation
Expand file tree
/
Copy pathUsingGit.txt
More file actions
118 lines (63 loc) · 2.17 KB
/
Copy pathUsingGit.txt
File metadata and controls
118 lines (63 loc) · 2.17 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
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
########## New Git Repo Creation and adding files ##########
create a new repository on GitHub. To avoid errors do not initilize the new repo with readme, license or gitignore files you can add these files after your project is created.
Open Git Bash
CD to working dir.
initliza local directory as GIT repo
$ git init
Add files to your new local repo. This stages them for first commit
$ git add .
# to unstage a file use 'git reset HEAD <your file>'
commit the files you've staged in your local repo.
$ git commit -m "first commit"
# commits the tracked changes and prepares them to be pushed to remote repo. To remove this commit and modify the file use 'git reset --soft HEAD~1' and commit and add the file again.
At the top of your GitHub repository's Quick Setup page, click [<--] to copy the remote repository URL.
$git remote add origin <remote repo url>
#sets the new remote
$git remot -v
#verifies the new remote URL
$git pull --rebase origin master --> if this is not done we face error "error: failed to push some refs to 'https://github.com/omkarvyas/<repo>"
$git push origin master
######### Removing files from the git repo and local ##########
git rm <filename>
git commit -m "removed filename"
git push origin <branch_name>
######### Updateing the file locally and pusing the file on the git #########
git status
git add <filename>
git commit -m "what was modified in the file"
git push origin <branch_name>
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########
######### #########