-
Notifications
You must be signed in to change notification settings - Fork 1
/
.githelp
59 lines (48 loc) · 2.03 KB
/
.githelp
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
States of files: tracked or untracked
tracked files: can be unmodified, modified or staged
untracked files: anything else
Checking
checking the status of files: git status
...for a more compact output: git status -s
Tracking
tracking new files: git add <pathtonewfile.c>
Staging
staging modified files: git add <pathtofile.c>
viewing staged and unstaged changes: git diff
viewing what was staged that will go into the next commit: git diff --staged
Committing
committing the changes: git commit -m <message>
skipping the staging: git commit -a -m <message>
Viewing
viewing the commit history: git log
showing the difference introduced in each commit: git log -p
prints on a single line: git log --pretty=oneline
Resetting back to a previous version (e.g. 9e5e6a4xxxx)
moving back the master branch HEAD: git reset --soft 9e5e6a4
... and updating the index: git reset 9e5e6a4
... and updating the working directory (risky): git reset --hard 9e5e6a4
Working with remotes
showing your remotes: git remote
with the URLs that Git has stored for the shortname to be used: git remote -v
adding a remote: git remote add <shortname> <url>
example: git remote add uge https://github.com/Universite-Gustave-Eiffel/bil
Pushing
pushing to remote uge: git push uge master
pushing to remote dangla: git push dangla master
Note: Github will no longer accept account passwords
for authenticating Git operations and will require
a personal access token.
Such a personal access token can be generated
in the github account by clicking:
Settings, Developer settings, Personal access tokens.
Select the scope "repo".
Use this personal access token as a password.
Tagging
listing the available tags: git tag
creating annotated tags: git tag -a <version> -m <message>
tagging later: git tag -a <version> <checksum>
Publishing a new release in github
click on "Releases" and "Draft a new release",
click on "Choose a tag" and enter a new tag such as "vX.Y.Z"
click on "Create new tag"
click on "Publish release"