github commit memo

…or create a new repository on the command line

 
echo "# test" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/abc/test.git
git push -u origin master

…or push an existing repository from the command line

 
git remote add origin https://github.com/abc/test.git
git push -u origin master

…or import code from another repository

You can initialize this repository with code from a Subversion, Mercurial, or TFS project.

 

 

 

conflict resolution

 

The prompt is already very friendly, and the answers I get from netizens directly help me solve the problem.

 

1.stash

Usually with this problem, you can just commit your changes; but I don't want that this time.

See how git stash does it.

 

git stash
git pull
git stash pop

 

Next, diff this file to see the automatic merging, and make corresponding changes.

git stash: Back up the content of the current workspace, read the relevant content from the most recent commit, and make sure that the workspace is consistent with the content of the last commit. At the same time, save the current workspace contents to the Git stack.
git stash pop: Read the last saved content from the Git stack and restore the relevant content of the workspace. Since there may be multiple Stash contents, the stack is used to manage it, and pop will read the contents from the most recent stash and restore it.
git stash list: Displays all backups in the Git stack, you can use this list to decide where to restore from.
git stash clear: Clear the Git stack. At this time, using graphical tools such as gitg, you will find that which nodes of the original stash have disappeared.

 

2. Abandon the local modification and directly overwrite it

 

git reset --hard
git pull

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326773774&siteId=291194637