-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit_commands.txt
More file actions
52 lines (33 loc) · 2.11 KB
/
git_commands.txt
File metadata and controls
52 lines (33 loc) · 2.11 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
#https://www.youtube.com/watch?v=73I5dRucCds
#https://www.youtube.com/watch?v=eL_0Ok_Gkas
https://www.youtube.com/watch?v=HVsySz-h9r4&t=326s ***best one
to log in type: git config --global user.name "username"
git config --global user.email "simeon.f.anderson@gmail.com"
to copy/download all the contents of the repo you are working on use:
git clone [add clone url]
we are in the (master) folder
git status --- tells you what was modified and what was not modified
to update a file you made changes to and add it to the staging area : git add [filename].md
to commit the changes in the files you added to the staging area and add a message enter:
git commit -m "[message]"
#committing is documenting the change and finalizing the staging area to push onto the repo
git log -shows you what you did
****if you aren't cloning a repo you have to add the origin:
git remote add origin [url of repo]
after adding the origin/or if it alread exits enter: gi push -u origin master
to get updated information if some one else is working on your github project enter : git pull
git difftool HEAD-- allows you to see the difference between whatever code you had previously vs whatever code you have now
to initialize a repo from the directory you are in use : git init
ls -la lists all of the files in a directory
- to stop tracking a project in git remove the git file from the directory
*******initialize a repo from exitising code*************
to ignore files create a .gitignore file
to remove files from the staging area: git reset [filename]
##########Trsck sn existing repo and develop on it####################
syntax: git clone <url> <where to clone>
view information about the remote repo: git remote -v
git branch -a
git remote -v = a location of where the repo is on the local macine
git remote -a = all of the branches in our repo, not only locally but remotely as well
git pull --pulls any changes that have been made since the last time we used it (it could've been used by
some one else)