Skip to content

Instantly share code, notes, and snippets.

@queirozsc
Last active October 13, 2018 05:32
Show Gist options
  • Save queirozsc/9e8802ae778cf98a45b1618fd7bedbdd to your computer and use it in GitHub Desktop.
Save queirozsc/9e8802ae778cf98a45b1618fd7bedbdd to your computer and use it in GitHub Desktop.
[Manipulando GitHub] #git
# Add untracked files + commit changes + push to server
git add -A && git commit -am 'Message' && git push ;
# Create a new branch
git branch experimental ;
# List all existing branches (note: asterisk marks the currently branch)
git branch ;
# Switch branch
git checkout experimental ;
# Merge the branch into master
git merge experimental ;
# View conflicts
git diff ;
git commit -a ;
# View graphic representation
gitk ;
# Delete a branch ensuring that the changes are already in the current branch
git branch -d experimental ;
# Destroying a branch
git branch -D crazy-idea ;
# Clone your CodeCommit repository to a local repository
git clone [CloneUrlHttp] [localrepository]
# View the history of changes
git log ;
# Complete diffs at each step
git log -p ;
# Overview of the change
git log --stat --summary ;
cd project
git init
git add .
git commit
# Commit to your repository
git push origin
git reset --hard HEAD^
git checkout cats.html index.html ;
# Inspect what others changed
git fetch remote-repo master ;
git log -p HEAD..FETCH_HEAD ;
gitk HEAD..FETCH_HEAD ;
gitk HEAD...FETCH_HEAD ;
# Fetch changes and merging into the current branch
cd project ;
git pull remote-repo master ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment