Git Merge your next Change

Sometimes when you want to merge changes made in another branch (in some remote) to your master branch. (or any branch supposed to be working)

When you trust and it works fine for sure, then it would be quite simple:

git merge  

And also we can use buttons on Github. But that’s kinda.. I wanted to make it “clear” manually. Again, when you trust this remote branch for sure:

git checkout master  
# go to your local master to begin  

git pull  
# make sure if anything in it up-to-date with remote master  

git pull origin feature_branch  
# and merge the branch you need from remote  

git push  
# and update remote master with your change  

git push origin :feature_branch  
# and remove the remote and..  

git branch -d feature_branch  
# local branch you don't need any longer  

but when you don’t trust, it’s not that you don’t trust but just in case you better test it before merge, as like in cases You got a pull request:

git fetch origin  
# bring it in from your project repository  

git checkout -b feature_branch origin/feature_branch  
# set up to track the remote branch from your local. "Just in case."  

git merge master  
# merge your safe master to this stranger for review  

and test.. solve conflict.. edit file and see if it’s really working. And you’re determined to merge.

git checkout master  
# go back to your local master  

git merge --no-ff feature_branch  
# you merge only current commit of feature_branch  

You know, they said it’s better here on git workflow.

git push origin master  

This is what I didn’t know but I googled. Hope it helps!

 
0
Kudos
 
0
Kudos

Now read this

레일스로 코딩 배우기

나는 루비가 코딩을 배우기에 좋은 출발점이라고 생각한다 Learn To Program 이라는 책을 읽어보라 https://pine.fm/LearnToProgram/ 물론 어느 programming language 로 시작하든지 코딩을 배우는 것은 인생에서 매우 중요하다고 생각한다 그리고 루비를 배우기에는 레일스가 좋은 출발점이라고 생각한다 지금 시작해보자 rails new app_name cd app_name 레일스의... Continue →