Get the App
SLTechnology News&Howtos  ›  Servers  › 

Git push met when he arrived at GitHub.

Shulou Source: shulou.com Published: 2022-06-03 09:56:59 12月06日 Update

1. Open git in the manage folder, type git init to initialize the local warehouse, and GitHub to create a remote warehouse manage

2. The following command is associated with local and remote repositories, * my user name

Git remote add origin git@github.com:**/manage.git

3. You already have the project code locally. After add and commit, you want to push to the remote warehouse.

Git push origin master

An error was reported at this time:

! [rejected] master-> master (non-fast forward)

.

.

After searching the Internet for a long time and entering all kinds of invalid and wrong commands, we finally found a solution:

1. Git pull origin master-- allow-unrelated-histories / / synchronizes the remote warehouse with the local one to eliminate differences

2. Re-add and commit the corresponding files

3 、 git push origin master

4. At this time, the upload will be successful.

Tags: Warehouse command file input success code method difference folder user user name error project association synchronization time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Information Huawei Docker macOS