воскресенье, 19 февраля 2012 г.

Полезные команды Git

Я начал использовать git совсем недавно и не могу назвать себя git экспертом. Но каждый день я сталкиваюсь с ситуациями и командами, описание которых, думаю, будет полезным для вас. Описание даю на английском, так как это будет понятнее.

Create and Checkout a New Branch
#branches from currently checked out directory
git checkout -b 

Checkout a Remote Branch
git checkout -b  origin/

Abort Changes of a File
git checkout -- 

Modify the Previous Commit’s Message
git commit --amend

Partial Change Checkin
git add --edit

Undo the Previous Commit
git revert HEAD^

Temporarily Stash Changes, Restore Later
# After changes have been made...
git stash

# Do some other stuff here, like switch branches, merge other changes, etc.

#Re-apply the changes
git stash pop

Delete a Remote Branch
git push origin :

Pull in the Latest from a Shared Repository
# Add a remote branch
git remote add  
 # For example:  git remote add lightfaceOfficial git://github.com/darkwing/LightFace.git

# Get changes from that branch
git fetch 

Tagging, Deleting, and Pushing Tags
# Create a Tag
git tag 

# Delete the tag
git tag -d 

# Push Tags
git push --tags

Who F’d it All Up?
git blame 

Комментариев нет:

Отправить комментарий