-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-commands
More file actions
46 lines (35 loc) · 1.9 KB
/
git-commands
File metadata and controls
46 lines (35 loc) · 1.9 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
Git Commands:
## Git linkes:
### git tutorial: for commands
https://learngitbranching.js.org/
http://rogerdudler.github.io/git-guide/
### git tutorial: for all around
https://hackernoon.com/understanding-git-fcffd87c15a3
### github edit README file cheat sheet:
https://help.github.com/articles/basic-writing-and-formatting-syntax/
Git commit : make new commit
Git branch “branch_name” : create a new branch
Git checkout “branch” : change the “pointer” to the branch
Git checkout -b “branch_name” : create a new branch and point on it at one command
Git merge “branch” : merge the branch to the pointer branch
Git rebase “branch” : reorganized the commit to a liner line
Git checkout HEAD^ : move head up one (the operator ^ take one perant up)
Git checkout HEAD~5: take head 5 perants up
Git branch -f master HEAD~5 : -f reassaing a branch to a commit
Git reset HEAD~1: take the pointer one back
Git revert HEAD : allows to sher changes
Git cherry-pick “commit1” “commit2” : make a copy of the commits to HEAD
Git rebase -i HEAD~3: allows to rearenge the commits to start from 3 perantes of head
Git clone “URL” : download the git files from the url
Git status : print the status of the project
list branches not working:
1. update the branches list with: "gir fetch"
2. list all branches : "git branch -a"
guide lines to working with git:
1. pull your branch from github with : "git pull origin <branch-name>"
2. make your changes in the local repository
3. add your changes by: "git add <directory-that-changed>"
4. commit your changes to the local repository : "git commit"
5. push your commit back to remote repository: "git push"
6. make sure that the local repository is connected to the remote repository: "git push --set-upstream origin <remote-branch-name>"
for this you may need to insert your github mail and username : "