Vous êtes sur la page 1sur 3

===========================================================================

=================================30-10-2018================================
URL utils
Git
http://rogerdudler.github.io/git-guide/index.es.html
Git Flow
https://dazzet.co/tutorial-de-git-flow/
https://danielkummer.github.io/git-flow-cheatsheet/
https://git-scm.com/book/es/v1/
UTils Comands
Prepare local folder for git
git init
Add files for git control version
git add .
Commit for stage area
git commit -m "some message"
Associate local folder from remote repository
git remote add origin https://site/repository
Push files
git push -u origin master
View remote repo (-v view url)
git remote -v
view details repo
git remote show name
Rename repo
git remote rename old_name new_name
Delete repo
git remote rm name
View current branch
git branch -a
Create branch
git branch branch_name
Download branch
git checkout branch_name
Merge
git checkout master
git merge branch_name
Delete branch (Local)
git branch -d branch_name
git branch -D branch_name
Delete branch (remote)
git push origin :branch_name
Update branch
git pull
Update branch from other branch(Example : Update feature from develop)
git pull origin develop
Discart local changes (modified)
git checkout --
git checkout file_name
Discart local changes (add)
git reset HEAD file_name
Add element last commit.
git commit --amend
--Create new Repo.
Clone
git clone https://
Change directory
cd path/directory
initialize
git init flow
Push branches
git push -u origin master
git push -u origin develop

-- process merge and resolve conflicts


Update my branch
git pull
View files modify
git status
Change branch from develop
git checkout develop
Update branch(for this case develop)
git pull origin develop
Change branch
git checkout feature/maps
Validate current branch
git branch
Merge between local develop and local branch(this can produce
errors[Conflicts])
git merge develop
Validate files modifications
git status
Save changes in git(start track)
git add .
Commit changes
git commit -m "resolve errors"
Publish changes.
git push.
--process hotfix
View files modified
git status
Upload changes in stash(section in memory)
git stash
Change branch
git checkout develop
Update branch
git pull origin develop
Create bugfix (this command create and move to branch)
git flow bugfix start maps-environments
Download changes from memory
git stash apply
Save changes in git(start track)
git add .
Commit changes
git commit -m "Fixes"
Publish changes
git flow bugfix publish
Clear stash
git stash clear

git remote -v
2035 git remote add origin https://walter_forero@bitbucket.org/rappinc/one-
workflow.git
2036 git flow feature publish stockout
===========================================================================

git flow init


git remote add origin https://gitlab.com/emgesa/appweb.git
git push -u origin master
git push -u origin develop
git flow feature start initial
git branch -a
git add .
git status
git commit -m "Initial commit"
git flow feature publish initial

Git global setup


git config --global user.name "walter forero"
git config --global user.email "walter.forero76@gmail.com"

Create a new repository


git clone https://gitlab.com/emgesa/webapp.git
cd webapp
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

Existing folder
cd existing_folder
git init
git remote add origin https://gitlab.com/emgesa/webapp.git
git add .
git commit -m "Initial commit"
git push -u origin master

Existing Git repository


cd existing_repo
git remote rename origin old-origin
git remote add origin https://gitlab.com/emgesa/webapp.git
git push -u origin --all
git push -u origin --tags

Ignore file local


git update-index --assume-unchanged <file>

Vous aimerez peut-être aussi