Git
Git Log
$ git log
$ git reflogChanging the git comment for already raised Pull Request
$ git fetch origin Dec04th
$ git commit —amend
$ git push origin Dec04th
(or, $ git push -f origin Dec04th)Update the PR, remove a file from a raised Pull Request
$ git checkout <origin/PRbranch>
$ git checkout upstream/master src/folder/filename.ext (can give absolute path)
$ git commit -m "no change in filename.ext"
$ git push origin <origin PRbranch>Git Squash / ot Fixup
// ~3 to see last 3 commit in head
$ git rebase -i HEAD~3
This command will open vi editor. replace 'pick' by 's' to squash the commit.
and use "f" instead of "s" if you don't want to keep the commit messages of old commits,
"f" will automatically remove the messages of old commits.
By doing so, your tip would be behind head. so you need to force push the changes.
$ git push origin <PRbranch> -fYou can also amend the commit, add file/change file without new commit id,
Fetch an unmerged pull request for a branch which you don't own
git branch
Remove untracked files from the working tree
HEAD is the symbolic name for the currently checked out commit.HEAD actually points to a branch’s ref and the branch points to the commit. HEAD is thus attached to a branch. When you make a new commit, the branch that HEAD points to is updated to point to the new commit. HEAD follows automatically since it just points to the branch.
so, when HEAD is detached, it points directly to a commit. instead of indirectly pointing to one through a branch.
Git reset commitID --hard/soft/mixed
--soft: uncommit changes, changes are left staged (index).--mixed(default): uncommit + unstage changes, changes are left in working tree.--hard: uncommit + unstage + delete changes, nothing left.
Problem:
After MacBook Pro to High Sierra upgrade, git command failed with following error:
Fix :
So, this looks something wrong with Xcode. Below worked for me.
Last updated
Was this helpful?