|
| 1 | +Here are the Git commands which are being covered: |
| 2 | + |
| 3 | +git config |
| 4 | +git init |
| 5 | +git clone |
| 6 | +git add |
| 7 | +git commit |
| 8 | +git diff |
| 9 | +git reset |
| 10 | +git status |
| 11 | +git rm |
| 12 | +git branch |
| 13 | +git checkout |
| 14 | +git merge |
| 15 | +git push |
| 16 | +git push --force |
| 17 | +git pull |
| 18 | + |
| 19 | +So, let's get started! |
| 20 | + |
| 21 | +Git Commands --> |
| 22 | + |
| 23 | +git config : |
| 24 | + |
| 25 | + Usage: git config �global user.name �[name]� |
| 26 | + |
| 27 | + Usage: git config �global user.email �[email address]� |
| 28 | + |
| 29 | + This command sets the author name and email address respectively to be used with your commits. |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +git init : |
| 34 | + |
| 35 | + Usage: git init [repository name] |
| 36 | + |
| 37 | + This command is used to start a new repository. |
| 38 | + |
| 39 | +git clone : |
| 40 | + |
| 41 | + Usage: git clone [url] |
| 42 | + |
| 43 | + This command is used to obtain a repository from an existing URL. |
| 44 | + |
| 45 | + |
| 46 | +git add : |
| 47 | + |
| 48 | + Usage: git add [file] |
| 49 | + |
| 50 | + This command adds a file to the staging area. |
| 51 | + |
| 52 | + |
| 53 | +git commit : |
| 54 | + |
| 55 | + Usage: git commit -m �[ Type in the commit message]� |
| 56 | + |
| 57 | + This command records or snapshots the file permanently in the version history. |
| 58 | + |
| 59 | + Usage: git commit -a |
| 60 | + |
| 61 | + This command commits any files you�ve added with the git add command and also commits any files you�ve changed since then. |
| 62 | + |
| 63 | + |
| 64 | +git diff : |
| 65 | + |
| 66 | + Usage: git diff |
| 67 | + |
| 68 | + This command shows the file differences which are not yet staged. |
| 69 | + |
| 70 | + Usage: git diff �staged |
| 71 | + |
| 72 | + This command shows the differences between the files in the staging area and the latest version present. |
| 73 | + |
| 74 | + Usage: git diff [first branch] [second branch] |
| 75 | + |
| 76 | + This command shows the differences between the two branches mentioned. |
| 77 | + |
| 78 | + Git Diff Command - Git Commands - Edureka |
| 79 | + |
| 80 | + |
| 81 | +git reset : |
| 82 | + |
| 83 | + Usage: git reset [file] |
| 84 | + |
| 85 | + This command unstages the file, but it preserves the file contents. |
| 86 | + |
| 87 | + Usage: git reset [commit] |
| 88 | + |
| 89 | + This command undoes all the commits after the specified commit and preserves the changes locally. |
| 90 | + |
| 91 | + Git Reset Command - Git Commands - Edureka |
| 92 | + |
| 93 | + Usage: git reset �hard [commit] This command discards all history and goes back to the specified commit. |
| 94 | + |
| 95 | + Git Reset Command - Git Commands - Edureka |
| 96 | + |
| 97 | + |
| 98 | +git status : |
| 99 | + |
| 100 | + Usage: git status |
| 101 | + |
| 102 | + This command lists all the files that have to be committed. |
| 103 | + |
| 104 | + |
| 105 | +git rm : |
| 106 | + |
| 107 | + Usage: git rm [file] |
| 108 | + |
| 109 | + This command deletes the file from your working directory and stages the deletion. |
| 110 | + |
| 111 | + |
| 112 | +git log : |
| 113 | + |
| 114 | + Usage: git log |
| 115 | + |
| 116 | + This command is used to list the version history for the current branch. |
| 117 | + |
| 118 | + Usage: git log �follow[file] |
| 119 | + |
| 120 | + This command lists version history for a file, including the renaming of files also. |
| 121 | + |
| 122 | + |
| 123 | +git show : |
| 124 | + |
| 125 | + Usage: git show [commit] |
| 126 | + |
| 127 | + This command shows the metadata and content changes of the specified commit. |
| 128 | + |
| 129 | + Git Show Command - Git Commands - Edureka |
| 130 | + |
| 131 | + |
| 132 | +git checkout: |
| 133 | + |
| 134 | + Usage: git checkout [branch name] |
| 135 | + |
| 136 | + This command is used to switch from one branch to another. |
| 137 | + |
| 138 | + Usage: git checkout -b [branch name] |
| 139 | + |
| 140 | + This command creates a new branch and also switches to it. |
| 141 | + |
| 142 | + |
| 143 | +git merge : |
| 144 | + |
| 145 | + Usage: git merge [branch name] |
| 146 | + |
| 147 | + This command merges the specified branch�s history into the current branch. |
| 148 | + |
| 149 | + |
| 150 | +git remote : |
| 151 | + |
| 152 | + Usage: git remote add [variable name] [Remote Server Link] |
| 153 | + |
| 154 | + This command is used to connect your local repository to the remote server. |
| 155 | + |
| 156 | + |
| 157 | +git push : |
| 158 | + |
| 159 | + Usage: git push [variable name] master |
| 160 | + |
| 161 | + This command sends the committed changes of master branch to your remote repository. |
| 162 | + |
| 163 | + Usage: git push [variable name] [branch] |
| 164 | + |
| 165 | + This command sends the branch commits to your remote repository. |
| 166 | + |
| 167 | + Usage: git push �all [variable name] |
| 168 | + |
| 169 | + This command pushes all branches to your remote repository. |
| 170 | + |
| 171 | + Usage: git push [variable name] :[branch name] |
| 172 | + |
| 173 | + This command deletes a branch on your remote repository. |
| 174 | + |
| 175 | + Git Push Command - Git Commands - Edureka |
| 176 | + |
| 177 | + |
| 178 | +git pull : |
| 179 | + |
| 180 | + Usage: git pull [Repository Link] |
| 181 | + |
| 182 | + This command fetches and merges changes on the remote server to your working directory. |
| 183 | + |
| 184 | + |
| 185 | + |
0 commit comments