-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3_commits
More file actions
42 lines (34 loc) · 1.41 KB
/
3_commits
File metadata and controls
42 lines (34 loc) · 1.41 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
//Sections
// 1. how to make commits
// 2. how to view commits
// 3. how to edit commits
// 4. how list commits for a specific file
// Section 1
// how to make a commit
// You will need to first make a change to the repository then stage the change before you commit
// Ex. echo "hello" >> example.txt
// git add example.txt or git add .
// Make your commit
git commit -m' this is the commit message tag'
// how to sign a commit
// you can manually sign a commit
//Section 2
//How to view commit Log
// display the 3 most recent commits
git log
// show a specified number of commits
git log -n '5' // this will show 5 commits..
// show commits from and too certain dates
git log --since=2015-03-03 // this will show commits beginning at 2015-03-03
git log --until=2015-03-25 // this will show commits up until 2015-03-25
git log --since=2015-03-03 --until=2015-05-15 // this is an example combining mutiple log options to show a specific range
// show commits from certain contributors
git log --author="username"
// Search commit messages
git log --grep='string you are searching for' // this will search for any commit with "string you are searching for" in the commit message
// list commits between two..
git log commitsha..commitsha
//Section 4
// to list commits for a specific file
git log filename
git log -p filename //this will show the diffs for every result