In Eclipse, right-click the file in Git repository explorer (in the working tree), and then select “Show in > History”. Then, select the two commits in the History pane (hold Ctrl when selecting commit items), and then right-click and select “Compare with each other.
Month: August 2020
Command | Description |
---|---|
git add [file] |
|
git add -i |
|
git branch |
|
git branch -a |
|
git branch [branch] |
|
git branch -d [branch] |
|
git branch –contains |
|
git branch –merged |
|
git branch –no-merged |
|
git branch –set-upstream-to origin/[branch] |
|
git branch -v |
|
git branch -vv |
|
git cat-file -p HEAD |
|
git checkout – <file> |
|
git checkout [branch] |
|
git checkout -b [branch] |
|
git checkout -b [branch] [remote]/[branch] |
|
git checkout –track [remote]/[branch] |
|
git checkout –track origin/[branch] |
|
git clone <URL>- |
|
git commit –amend |
|
git commit -m ‘message text’ |
|
git config –list |
|
git diff |
|
git diff HEAD |
|
git diff –cached |
|
git diff –check |
|
git diff –staged |
|
git fetch [remote] |
|
git fetch –all |
|
git grep -n [search term] |
|
git grep –count [search term] |
|
git help <verb> |
|
git init |
|
git log |
|
git log –graph |
|
git log -p -2 |
|
git log –pretty=oneline |
|
git log –since=2.weeks |
|
git log –stat |
|
git log [branch1]..[branch2] |
|
git log [remote]/[branch].. |
|
git log refA refB ^refC |
|
git log [branch1]…[branch2] |
|
git log -S [search term] |
|
git log -L :[function name]:[file name] |
|
git ls-files -m |
|
git ls-tree -r HEAD |
|
git merge @{upstream} |
|
git merge [branch] |
|
git merge –abort” |
|
git mergetool |
|
git mv <file_from> <file_to> |
|
git pull [remote] |
|
git push [remote] [branch name] |
|
git push [remote] –delete [branch] |
|
git push [remote] [tag name] |
|
git push [remote] –tags |
|
git push –set-upstream [remote] [branch] |
|
git remote show [remote] |
|
git remote |
|
git reset <file> |
|
git reset [commit] |
|
git reset HEAD~ |
|
git reset –hard HEAD~ |
|
git reset –mixed HEAD~ |
|
git reset –soft HEAD~ |
|
git rev-parse branch |
|
git rm <file> |
|
git show |
|
git show HEAD@{n} |
|
git show [branch]@{yesterday} |
|
git show HEAD@{2.months.ago} |
|
git show HEAD^ |
|
git show d921970^2 |
|
git show HEAD~n |
|
git stash |
|
git stash list |
|
git stash apply |
|
git stash apply index |
|
git stash drop stash@{n} |
|
git stash pop |
|
git status |
|
git status -s |
|
git tag v1.4 |
|
git tag |
|
Command | Description |
---|---|
add | Add file contents to the index |
bisect | Find by binary search the change that introduced a bug |
branch | List, create, or delete branches |
checkout | Checkout a branch or paths to the working tree |
clone | Clone a repository into a new directory |
commit | Record changes to the repository |
diff | Show changes between commits, commit and working tree, etc |
fetch | Download objects and refs from another repository |
grep | Print lines matching a pattern |
init | Create an empty git repository or reinitialize an existing one |
log | Show commit logs |
merge | Join two or more development histories together |
mv | Move or rename a file, a directory, or a symlink |
pull | Fetch from and merge with another repository or a local branch |
push | Update remote refs along with associated objects |
rebase | Forward-port local commits to the updated upstream head |
reset | Reset current HEAD to the specified state |
rm | Remove files from the working tree and from the index |
show | Show various types of objects |
status | Show the working tree status |
tag | Create, list, delete or verify a tag object signed with GPG |
You can exit a listing by pressing Ctrl+c.
I documented a new feature a month ago, and it’s now live. But now 3rdParty wants me to pull it – because the commercial launch has been delayed.
Since you use a Git branching model to separate your work-in-progress from your published work, and then once you’ve completed the new work, you then merge it into the published doc set, you should be able to solve this issue using Git.
You can remove the content by reversing the commit that represents it. When it’s time to put the content back, you do it by reverting the revert commit. You might think it makes sense to merge the content back in, as you originally did, but Git has captured that “action” as a commit object already (as a dimension, the concept of time takes on properties and behaviors in Git world!).
Here’s my research source: http://git-scm.com/blog/2010/03/02/undoing-merges.html
Notes
In Eclipse > Git Reflog (Java (Writing) perspective).
Looking at the entries in the Reflog Message column, you can easily see where new content was merged into your local main line branch. They’re the “Merge Commits” – the ones with the “merge” icon.
Can you filter-out all of the other commit types? Yes! Simpy type “merge” into the Filter field, and press Enter.
git ls-files
git reset HEAD~1
I’m still not sure how this happened. It could have resulted from switching back and forth between the MobileUserDocs branch and the 2WaySMS branch. You altered your .gitignore to have it ignore
- Find the commit that deleted the file.
git rev-list -n 1 HEAD -- <file_path/>
E.g.,
git rev-list -n 1 HEAD -- doc/user/v1/source/mobile-content/topics/procedures.dita
- Checkout the file.
git checkout a39f1d72964dfc6240a7c1d9678a4add9b8bdb7d^ -- doc/user/v1/source/mobile-content/topics/procedures.dita
Or in one command
If $file is the file in question.
git checkout $(git rev-list -n 1 HEAD -- "$file")^ -- "$file"
Note: You must include the quotes.
E.g.,
File Name: “doc/user/v1/source/mobile-content/topics/concepts.dita”
git checkout $(git rev-list -n 1 HEAD -- "doc/user/v1/source/mobile-content/topics/concepts.dita")^ -- "doc/user/v1/source/mobile-content/topics/concepts.dita"
Just check it out, using its local name.
E.g.,
git checkout release/current
1. Always use the local feature/api_doc as the starting point
git checkout feature/api_doc
2. Update your local repository
git fetch origin
3. Set the command options
When creating a new branch, set up configuration to mark the start-point branch as “upstream” from the new branch.
--track
Create the branch’s reflog. This activates recording of all changes made to the branch ref, enabling use of date based sha1 expressions such as “<branchname>@{yesterday}”.
-l
The name of the new branch
"MobileUserDocs"
Issue the command
git branch –track -l MobileUserDocs
4. Checkout the new branch
And start working on the AuthID End User documentation.
checkout MobileUserDocs
5. Update your .gitignore file to exclude oXygen’s temp files
doc/user/v1/source/mobile-content/temp
6. Add the new content files to the local repo
Use Stage Changed to get all of the new source files, as well as the 3rdParty.css fileds, the tsmobile.ditamap file, the .project file, and the .gitignore file.
E.g., commit message
First draft of End User documentation.
- git clone git@git.c11.3rdParty.com:mobile_assets.git.
- git fetch –all.
- git checkout develop.
- git checkout -b feature/doc_update.
- git push origin feature/doc_update.