Git 썸네일형 리스트형 Remove/Change Previous Commit * When trying to delete any of the previous commit,If aaa is the hash to remove,1. > git rebase -i aaa^2. Remove that commit(aaa)3. If there is a conflict, (if not continue..)==> resolve conflict > git add . > git rebase --continue4. > git push -f origin my-branch-name * When trying to undo pushed commit,1. > git log and get the hash(aaa) to revert to2. > git push -f origin aaa:my-branch-nameIf .. Rebase My Branch on Top of Something * When trying to rebase my branch on top of develop(or master branch),On my branch..> git rebase origin/develop> git push -f origin my-branch-name * When trying to rebase A onto B branch,On the branch A,> git rebase B A> git push -f origin A Undoing Changes When you wanna undo what you just did, git can help us to do that. When you made changes by mistake, 1. git status2. git diff ex) // all of those text was removed3. git checkout index.html git checkout -- index.html// means stay on the current branch ex) resources.htmlafter git add, how to unstage those changes ==> git reset HEAD resources.html//means.. "Go look at the head pointer. The Head poi.. How to view the commit log See what changes were commited. What is changed in the project $ git log// commit : each commit has its own id// Author : author of the commit// Date : date the of the commit // and messages.. $ git help log$ git log -n 1$ git log -n 2//git log -n #of commits $ git log --since=2012=06=15 $ git log --until=2012-06-15 $ git log --author="Kevin" $ git log --grep="Init"// global search Performing first commit 1. Make changes 2. Add the changes$ git add .// tell git the changes everything you made (. : this directory) 3. Commit changes to the repository with a message$ git commit -m "Initial commit"//commit! put it in your repository ** Writing commit messages- message tells us what is in the set- short single-line summary (less than 50 chars)- optionally followed by a blank line and a more complete d.. Initializing a repository $ git init// get everything ready to start git writing 1. make git directory: first_git_project2. in cmd line - $ cd Documents/first_git_project - $ git init // things in this directory are things to be aware of// "Hey Git, this is the directory you need to track of"// .git file should be inside the repository because it can make trackingls -la .git //leave it alone.. Installing Git Git Website: http://git-scm.com: for mac.. http://git.scm.com/download/mac In terminal> Which git> git --version In Windows..Git Bash (same command as unix)> ls -al> which git> git --version In Ubuntu> apt-get install git-core Basic configuration of Git* System level configurationin Unix /etc/gitconfigProgram Files\Git\etc\gitconfig * Single User configuation~/.gitconfig$Home\.gitconfig * Projec.. About Distributed Version Control They are all central repository version control modelOne Central spaceCheck out the master repository -> work with it and make changes -> submit those changes back to the central repository Git is Distributed version control: different users (or teams of users) maintain their own repositories instead of working from a central repository: Their changes are stored as "change sets" or "patches": Tr.. Understanding version control What is Git?: Keeps track of changes especially text changes: version 1, version 2, version 3. Git keeps track of those versions back and forth. See what changed between two versions. Version Control System (VCS): This is for managing source code. to track those changes Source code management (SCM) Examples of primitive version control (non-source code)- File naming (different file names) to kee.. Prev 1 Next