| ... |
... |
@@ -113,4 +113,25 @@ |
| 113 |
113 |
|
| 114 |
114 |
To push your commits on the command line, enter {{code language="none"}}git push{{/code}}. |
| 115 |
115 |
|
|
116 |
+= Getting Earlier Versions of Files = |
|
117 |
+ |
|
118 |
+If you want to revert //all// your local changes and get back to the previous repository state, use {{code language="none"}}git reset --hard{{/code}} or the //Reset// item in the EGit context menu. If you only want to revert some specific files, do one of the following: |
|
119 |
+ |
|
120 |
+* Right click the files, click //Replace With//, click //HEAD Revision//. |
|
121 |
+* Enter {{code language="none"}}git checkout <path>{{/code}} on the command line. |
|
122 |
+ |
|
123 |
+By giving a branch, tag, or commit number in git checkout <commit> <path>, you can get to any existing version of the files. If no path is given, git checkout <commit> switches your whole working copy and index to the specified branch, tag, or commit number. If git reset is given a commit number, the current branch is modified to point at the given commit. |
|
124 |
+ |
|
125 |
+{{warning}} |
|
126 |
+This is a brute force modification, and you probably won't be able to push the new branch |
|
127 |
+{{/warning}} |
|
128 |
+ |
|
129 |
+= Cleaning Your Working Directory = |
|
130 |
+ |
|
131 |
+In case the working directory is messed up with unstaged files, which are not affected by git reset ~-~-hard, a clean up is achieved by means of git clean -f. The additional switch -d applies this to directories, respectively. Hence, git reset + git clean act like svn revert. |
|
132 |
+ |
|
133 |
+git clean -X removes only the files that are ignored by Git, that is mainly the .class files generated by the Java compiler. A full rebuild is required afterwards. |
|
134 |
+ |
|
135 |
+= Branching and Merging = |
|
136 |
+ |
| 116 |
116 |
|