git branch organizations and submitted to merge

git submitted to the warehouse

 

View the path of your remote warehouse. 

Remote git - v 

path configuration of the original repository: 

git the Add Remote Origin HTTP **** 

git the Add Remote upstream HTTP **** 

git Remote the SET -url Origin HTTPS: // github.com/1702h06/shopcar.git 


again to view the remote location directory: 

git Remote - v 

can first look at the current location branch 

git branch 

to create local branches and switch to the newly created branch 

git Checkout - b dev 

git branch 

to branch information newly created pushed to GitHub 

git the push Origin the HEAD - U 


1 into the project folder, the command git init to initialize the project into a local git repository 

git init         

2 , all the files within the project are added to the staging area 
git the Add. 

3The present times submitted for comments, in order to later versions of rollback and other operations 

git the commit -m ' xxx ' // xxx is the content of this submission notes 4 , create a new repository on github, copy the address of the warehouse, and then use the command local repository connection to a remote repository 
git the Add remote Origin xxx        // xxx is the address of the git repository 5 , will push the files to the staging area in the remote repository (using a forced push ' -f ' is because in general when the new warehouse will generate read me file, resulting in the need to git fetch to push, but the read me file really is not necessary, because the general will generate a read me file when generating local projects, so I chose direct push push in the past.) 
git the push Origin Master -f 





 

 git branch merge

  

1 . Dev create a branch, and immediately switch to the branch dev 

Git Checkout - B dev 

2 . See the current branch 

Git Branch 

. 3 combined first branch. 

Git Merge Origin / <Branch name> . 4 continues to incorporate the new branch. 
Git Merge Origin / <branch name> 
to resolve conflicts 
conflict resolution is completed will merge good code submitted to the dev branch 5 . all the files within the project are added to the staging area 
git the Add. 6 . the submission of conduct notes, to post-version rollback and other operations 
git the commit -m ' hebing ' // xxx is the contents of the memo submitted 7 would push the files to the staging area of the remote repository (using a forced push ' -f '










 


Because generally when the new warehouse will generate a read me file, resulting in the need to git fetch to push, but the read me file really is not necessary, because the general will generate a read me file when generating local projects, so choose direct push push past. ) 

Git Push Origin dev - F 

currently dev is the latest code 

8 . Switch to your branch pull dev upper latest code 

Git Checkout <Branch name> . 9 to view the current branch. 
Git Branch 10 pull dev codes. 
Git pull Origin <branch name>





 

  

 

Guess you like

Origin www.cnblogs.com/p-123/p/11459761.html