Sunteți pe pagina 1din 1

git add -A : git add .

; git add -u
git add -u : looks at all the currently tracked files and stages the changes to
those files if they are different or if they have been removed. It does not add
any new files, it only stages changes to already tracked files
git add . : it looks at the working tree and adds all those paths to the staged
changes if they are either changed or are new and not ignored, it does not stage
any 'rm' actions.
git add <file> : stage file
git branch -a : see branch list
git branch -d [branch name] : delete local branch
git branch -m [new branch name]: locally rename the current branch - you have to
be on the rbanch you want to rename and the branch can;t have remote
git branch -m <oldname> <newname>
git checkout -b [branch name] - create a new branch and switch to it (same as g
it branch [branch name] + git checkout [branch name])
git checkout [branch name] - switch to a specific branch
git cherry -v [source-branch] [target branch] - show commit log for target branc
h, assuming it was made from source-branch
git clone : checkout project
git commit --amend : change last commit message
git diff --staged : what yogu staged and will go into the next commit
git diff : see changed but not staged
git fetch [remote] - remote = origin, for example Fetches named heads or tags fr
om one or more other repositories, along with the objects necessary to complete
them.
git log --oneline --graph --color --all --decorate
git log --oneline --graph --decorate --all
git log --pretty=oneline --graph --decorate --all
git log --since=2.days
git log --since=2.days --stat
git log : show commit log
git merge
git pop - unshelve local/uncommitted changes
git push -u origin <branch> : push new branch to server
git push [remote-name] [branch-name] : push changes to the server
git push origin dev : push local changes from the dev branch to the server on th
e dev branch
git remote set-url origin ssh://git@git.svc.ft.com:7999/ftfal/ft-cms.git
git remote -v : see your remotes
git reset HEAD [staged file] - unstage staged file
git stash - shelve local/uncommitted changes
git stash --keep-index : This will stash everything that you haven't previously
added. Just git add the things you want to keep, then run it.
git stash apply [name] - apply a specific stash
git stash list - check the stashes
git stash show - if there's one stash, show the changes files
git stash show -p stash@{0} - show a particular stash diff in this case, stash@{
0}
git status: see what's changed
gitk --all : view commit tree
git rebase - done on master, and we say which branch to rebase
git rebase --interactive
===============
Git rebase
==========
checkout mybranch
git rebase develop (where develop is the branch mybranch was made from)
git merge origin/mybranch mybranch
git push origin mybranch

S-ar putea să vă placă și