-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitcommand.txt
More file actions
134 lines (93 loc) · 3.13 KB
/
gitcommand.txt
File metadata and controls
134 lines (93 loc) · 3.13 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
http://gitref.org/remotes/
DAY - 1
git init
git status
git add .
git commit -m "Comment"
git status -s
git commit -a -m "Adds new message"
git commmand --help
-a should be first, so that it can add the file to staging first. And then use -m to commit to repo
condole.log('test')
DAY - 2
git gui
All the unstaged file will be shown on the Unstaged Changes window.
. Click on the icon of the file to add it to the staging environment.
. Commit only single file
. git checkout "filename"
- to undo changes from working directory
- to switch branch
git checkout Filename - To undo changes from the working directory
use wildcard characters
git checkout -- *.txt
.gitrep ???????
commit eb715ce22787c101bf0b6a6278acdb9a2a6b09bd
Author: unknown <trng6@CT2-TRNG6-25.cybage.com>
Date: Mon Jun 8 12:26:54 2015 +0530
Adds new directories
commit 368e759cbcc95cbba94623c274c7ac78bcce7535
Author: unknown <trng6@CT2-TRNG6-25.cybage.com>
Date: Mon Jun 8 12:22:23 2015 +0530
adding more files
commit ee228ba8aa2f1bbd2da322f45b0a4ddeb44c8016
Author: unknown <trng6@CT2-TRNG6-25.cybage.com>
Date: Mon Jun 8 12:15:48 2015 +0530
more new commends
commit f09930037db68728e9c274ff756ec65ec2f52590
Author: unknown <trng6@CT2-TRNG6-25.cybage.com>
Date: Mon Jun 8 12:12:32 2015 +0530
if you rollback the last one, GIT will rollback all the other commits after that as well.
this is because it maintains the data integrity
git reset HEAD
- This will rollback everythying to the working directory
- There are other commands to rollback as well
git commit amend - URL
https://www.atlassian.com/git/tutorials/rewriting-history/git-commit--amend
git commit --amend --no-edit
git commit --amend -m "Comment"
git show CHECKSUM
12d50f86c7162a68e410915de35e1511d2329ea8
git log -n 3
will show only last 3 commits
git reset --hard HEAD^ - To rollback the last commit
git reset --hard HEAD~5 - To remove all last 5 commits
git revert checksum ?????? Advanced Session
git log > backup.txt
cat filename - To show the file
git reset --soft HEAD^
git clean -f
Will remove any untracked file from.
-f used to forcefully clean
Rename file -
git mv file1.txt file2.txt
Remove the file -
git rm backup.txt
GRUNT ------
npm install grunt-cli -g :: To install the gruntt-cli at global level
npm init - To start creating a new Package.json
npm install grunt --save-dev : To install the Grunt file as a dev dependency
************ Sample Grunt file *************
'use Strict'
module.exports = function(grunt){
grunt.log.writeln('Running Grunt Task...')
grunt.registerTask('hello',function(fName){
console.log(arguments.length);
console.log('Hello '+fName);
console.log('********** '+this.name);
});
grunt.registerTask('callme', function(){
console.log('Callme.....')
});
grunt.registerTask('Google', function(){
console.log('Calling Google.....');
grunt.registerTask('cybage', function(){
console.log('cybage cybage cybage');
});
});
//grunt.registerTask('default',['hello:Welcome Singh','callme', 'Google']);
grunt.registerTask('website',['Google', 'hello:WOW']);
/*function testme(){
console.log('test task runner');
}
grunt.registerTask('test',['testme']);*/
}