1, add
# git clone git@192.168.10.202:develop/test.git
# CD Test
# Touch Test.txt//test files
# git add test.txt//git adding files
# git commit-m ' Test '//Add to local version library
# git push//push to remote
If push complains, perhaps you should specify a branch such as ' master '
Solution:
# Git push Origin master//As long as this is done, you can use Git push later
adding files and adding directories is the same operation.
2, modify the file
Method One
# echo "11111111111" > Test.txt
# git add test.txt && git commit-m ' test2 '
# git push
Method Two
# echo "abc" > Test.txt
# git Commit-am "test3"/all modifications will be submitted
# git push
What if you have multiple files and you want to submit only one or more of them?
# git commit-a//This command appears with the following contents
# Please enter the ' commit ' for your changes. Lines starting
# with ' # ' would be ignored, and a emptyempty message aborts the commit.
# on Branch Master
# Changes to be committed:
# (use ' git reset head <file> ... "to Unstage)
#
# Modified:ab
# Modified:test.txt//If only want to submit the test.txt, just put the line before the # Remove, save the exit on the line
# git push//exit after executing push
3, delete
# git RM ab//If delete directory, plus-R
# git commit-am "del"
# git push
4, conflict resolution
# git push//push don't go up
Address 192.168.10.202 maps to unassigned.psychz.net, but this does not map back to the address-possible break-in attemp T!
To Git@192.168.10.202:develop/test.git
! [Rejected] Master-> Master (Non-fast-forward)
Error:failed to push some refs to ' 192.168.10.202:develop/test.git '
To prevent losing history, Non-fast-forward updates were rejected
Merge the remote changes before pushing again. The ' note about
Fast-forwards ' section of ' git push--help ' for details.
# git pull//update code, hint conflict
Address 192.168.10.202 maps to unassigned.psychz.net, but this does not map back to the address-possible break-in attemp T!
Remote:counting Objects:5, done.
Remote:compressing objects:100% (2/2), done.
Remote:total 3 (Delta 0), reused 0 (Delta 0)
Unpacking objects:100% (3/3), done.
From 192.168.10.202:develop/test
367dad3.. 5e5640b Master-> Origin/master
Auto-merging Test.txt
CONFLICT (content): Merge CONFLICT in Test.txt
Automatic merge failed; Fix conflicts and then commit the result.
# VIM Test.txt//modify conflict file, and save
# git Commit-am "remove conflict"//resubmit to local version library
# git push//sync to remote