-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit_commands
More file actions
38 lines (29 loc) · 1.36 KB
/
git_commands
File metadata and controls
38 lines (29 loc) · 1.36 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
-> uploading a new file
1) add the new file in the directory
2) git add <name of the new file> eg: git add abc.testing
3) git commit -a -m "<message>" eg: git commit -a -m "adding a new file"
4) git push origin
-> uploading changes in an existing file
1) change an existing file in the directory
2) git commit -a -m "<message>" eg: git commit -a -m "adding a new file"
3) git push origin
-> downloading changes
1) git pull origin master
-> to check if you have any changes
1) git status
2) git diff -> shows the modifications in existing files
3) git checkout <fileName> -> reverts any changes in the file
-> HOW to setup an existing repo on a new machine
1) get git on that machine
2) generate the SSH keys and put it on git hub
i) ssh-keygen -t rsa
ii) cat ~/.ssh/id_rsa.pub
iii) copy the output of step ii to git-hub https://github.com/settings/ssh
3) create a new folder where you want to setup your git-hub repo on your computer
4) go to that directory and initialize git
i) cd <path/to/dir>
ii) git init
5) git pull <repo path> eg: git pull git@github.com:nitivachhani/trainingStuff.git
6) git remote add origin <path to git repo>
eg: git remote add origin git@github.com:nitivachhani/trainingStuff.git
-> for setting up git on windows follow steps metioned on http://help.github.com/win-set-up-git/ and then follow up from steps 3 onwards mentioned above.