-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit_notes.txt
86 lines (64 loc) · 3.04 KB
/
git_notes.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
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
Dirty, Staged, Local, Remote
// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
git init - to create a file for dirty code
git add - to go to staged version of code
git commit - to store in local
git push - to store in remote
git status - to show staged code not yet commited
git branch BRANCHNAME - to create a new branch
git checkout BRANCHNAME - to check out a previously created branch
git checkout -b BRANCHNAME - to create and check out a branch
git branch -d BRANCHNAME - to delete a branch
ls - lists the content in a directory (?)
git commit --amend - to edit previous function
// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
cannot create array with variable length
return array from a function using struct or global
// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
unit test, integration test, end-to-end test
// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
To create a new GitHub repository, open it in VSCodium, and link it to main:
---------------------------------------------------------------------------
create the new repository in GitHub webpage
in VSCodium, go to Source Control --> Clone Repository --> Clone from GitHub --> Allow --> copy code and continue to GitHub --> paste code --> activated --> go back to VSCodium --> choose repository to edit
// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
To connect GitHub and VSCodium and get the repository to edit:
-------------------------------------------------------------
cd ~/dev/rakshita/c-beginner
code .
// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
To download a new App:
---------------------
brew search chrome (for example)
code ~/Brewfile
bupc
# With GUI, then in casks, else in brew/formulae
// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
To save code in GitHub:
----------------------
git add -p
git ci "036 - minor changes"
git push
st
// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
To rename a file:
----------------
git mv <OLD-FILENAME> <NEW-FILENAME>
git push
// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
To run the program:
------------------
clang ./036_chutes_and_ladders.c -o ./036_chutes_and_ladders
./036_chutes_and_ladders
[OR]
clang ./038_pointers.c -o ./038_pointers && ./038_pointers
// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
Every Week:
----------
cd
git fo (git fetch origin)
// ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
Note for accepting two strings with spaces:
------------------------------------------
scanf("%[^\n]", arr); // [^\n] stops the input only when it encounters a new line command and not space
fflush(stdin); // to 'start over'