-
Notifications
You must be signed in to change notification settings - Fork 0
/
git-tricks.txt
52 lines (35 loc) · 1.11 KB
/
git-tricks.txt
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
:: Creating a new project::
git init
~Innitialize a new empty git repository in this folder~
git add .
~Adds all the files in the current folder and in its subdirectories~
git status
~Show the current status~
git commit --author="<author> <<email>>"
~Commit mensage~
git remote add origin https://github.com/<user>/<repository>
~Define which is the destination of the commit~
git push -f origin master
~Makes the first commit forced~
git checkout -b <newbranch>
~creates a new local branch~
git status
git add .
git commit ...
~Makes the same thing that I already said
git push origin <newbranch> --set-upstream
~sync the remote branch with the local~
git branch -d <branch-name>
~delete local branch~
git push origin :<branch-name>
~Upload deleted branch action~
git remote add <nomedoremote> <pathdoremote>
~Adds a remote to git~
git remote
~List the remote list~
git remote show <remotename>
~show informations about remote, like url~
git remove -v
~list the remotes links~
git remote set-url <remote_name> <remote_url>
https://orrsella.com/2013/08/10/git-using-different-user-emails-for-different-repositories/