Install Git
If you already have Git installed, you can get the latest version of Git itself:
git clone https://github.com/git/git
Copy the code
Uploading a Local project
Git Bash Here ==Ctrl+E==
git init
git add .
git commit -m "first commit"
Copy the code
Log in to Github and click + Create repository from the navigation bar. After naming the repository, click Create Repository. Git == go back to the git command prompt and type:
Git remote add origin [email protected]: account name/repository name git git -u push origin masterCopy the code
appear
Enumerating objects: 748, done.
Counting objects: 100% (748/748), done.
Delta compression using up to 4 threads
Compressing objects: 100% (624/624), done.
Writing objects: 100% (747/747), 314.10 KiB | 580.00 KiB/s, done.
Total 747 (delta 67), reused 0 (delta 0)
remote: Resolving deltas: 100% (67/67), done.
To github.com:2020chen/wyuRentalHousing.git
f2056d8.8398.dad master -> master
Copy the code
Local projects are uploaded to Github
Some of the problems
Git push: “Everything up-to-date”
The reason:
1Git add is not running.2Git commit -m was not run"Submit information"
Copy the code
Git push -u: git push -u: git push -u: git push After a successful upload, there is no need to add -u when the code needs to be synchronized again.
Error: Filename too long is displayed when git push is performed
From the git command prompt, run the following command:
git config --global core.longpaths true
Copy the code
Can solve the problem.
–global is the scope of this parameter. If you want to set this parameter only for this repository, simply remove –global from the command above.
Error: Failed to push some refs to ‘[email protected]: account name/repository name. Git ‘
Cause: Your local repository is not the same as the repository created on Github. You can run the git command prompt first
git pull origin master
Copy the code
Git push origin master== The above. In subsequent updates ~~