1. setup git diff tool in
~/.gitconfig
[diff]
tool = p4merge
You can use git difftool
to show a single commit.
Say you want to see the commit with the sha1 abc123
:
git difftool abc123~1 abc123
(~1
tells git to move to the previous commit, so abc123~1
is the commit before abc123
)
If you use this regularly, you could make a custom git command to make it easier:
Create a file called git-show
somewhere on your $PATH
with the following contents:
git difftool $1~1 $1
Give that file execute permissions:
chmod +x ~/path/to/git-show
Use the command git-show <sha1 or tag or ...>
For the modified files on current branch:
git difftool ./my_modified_file
After git add command (staged files)
git difftool --staged
2. git show current branch name:
git branch
3. git show all remote branches:
git branch --all
4. git switch branch:
git checkout my_branch_name
5. git Add file:
git add ./path/my_file.txt
6. git commit changes:
git commit -m "my change text"
7. git push
git push
8. git log, show change history
git log
9. delete remote branch
git push origin --delete branch_name
10. branch diff
git diff master_git master_git_test
11. Create a local branch test which will use to track remote branch origin/test:
git branch test origin/test
No comments:
Post a Comment