Some errors and solutions encountered in using GIT

    GIT bash is uploaded to a way of github. In the course of encounter some errors, where I talk about my problems and solutions.

 Let me talk about the way I push the file. Github copy the URL from the above, use git clone + URL cloned into local. Then open, there will be a .git file, this file is hidden, need points to open the file above to view the check View hidden.

 General operation is 1. Git add * 2. Git commit -m "comment" 3. Git push origin master said about the third step, origin referring to submit to a remote branch.

 But the normal operation also make mistakes. When you create a branch using git checkout -b branch and then want to switch back to the master branch, but use git checkout master will get an error, prompting you mean to say you did not commit had something in the master, so you can not switch. This time the solution is 1. Git branch 2. Git checkout master can smoothly switch back to the master branch. But must pay attention to git branch must have a master branch under otherwise must not switch back.

 When I push things, push step error, suggesting that I could not push more than a 100M file, I first encountered this problem. Previously I did not know there is this limit. Then I put this more than 100M of files and then push to remove then commit or will be reported out of this problem. I did everything from the Internet to find a solution, the most powerful such as under a bfg-1.13.0.jar package, put under git directory, execute the command to clear more than 50M of history. There are also installing LFS can not be solved.

 My solution is to re-cloned into github to local, it has the following steps.

 1 . git checkout -b master

 2 no master remote branch: git push -u || remote master branch will also appear remote has a master branch, direct implementation of the third step.

 3. The next step is remote and local master branch connected git branch -u origin / master master

 This can be resubmitted, be sure to remember to delete more than 100M of files.

Guess you like

Origin www.cnblogs.com/yanzhao-x/p/10962379.html