Skip to content

Instantly share code, notes, and snippets.

@juankiz123
Forked from oshingc/Git Commands
Last active August 29, 2015 13:57
Show Gist options
  • Save juankiz123/9412196 to your computer and use it in GitHub Desktop.
Save juankiz123/9412196 to your computer and use it in GitHub Desktop.
//Get the project
git clone git@github.com:username/repositoryname.git
//Make changes to the project
//Problem! You made changes to the project beeing on master branch, how do you save those changes to a new branch?
//Save a stack
git stash
//Check actual file mode
git config core.fileMode
//Set file Mode to false if file mode is true
git config core.fileMode false
//fetch develop branch, make the branch appears
git branch --track develop origin/develop
develop
*master
//change to the branch develop
git checkout develop
*develop
master
//change to a new branch 'cambio'
git checkout -b cambio
*cambio
develop
master
//recover the changes we save on the stack to the branch cambio
git stash pop
//prepare to commit
git add -A
git commit -m "we add constants"
//Check the state of fileMode, should be false
git config core.fileMode
false
//Push our branch cambio
git push origin cambio
//The next step is go to github.com and Create Pull Request
//Edit and select develop>cambio
//Send Pull Request
//Merge Pull Request
//END
@juankiz123
Copy link
Author

//Para borrar un branch
git branch -D "nombre del branch"

@juankiz123
Copy link
Author

//Para limpiar archivos inutiles, generados al momento de hacer merge con archivos en conflicto
git clean -f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment