some advance git commands - tingxingdong/clBLAS-private GitHub Wiki
//create a new branch
git checkout -b new_branch
//switch to a existing branch
git checkout existing_branch
The remote branch is automatically created when you push it to the remote server. So when you feel ready for it, you can just do:
git push
//keep password
git config βglobal credential.helper store
//save existing files not commit yet
git stash save a (means all)ββββββββββββββββββββββββββββββββββ-
//see log
git log
//pop back files you save in last command
git stash pop
-
error: pathspec βcommitββ did not match any file(s) known to git.
solution: you may carelessly add an git init just, delete it by βrm -rf .gitβ
If you change your remote project name
see this
https://blog.cloudtroopers.com/rename-github-repository-without-fear
============
If I want to combine last 4 commits, but I have already push to my cloud_repo , I can do this in my terminal/
On a branch I was able to do it like this (for the last 4 commits)
git reset βsoft HEAD~4
git commit
git push βforce my_cloud_repo my_local_branch
============
How to merge with a remote named upstream
1) git pull upstream
2) git merge upstream/develop
3) it will probably shows you some conflicts.to solve them
e.g.
git checkout -ours -
- or
git checkout-theirs -
4) finally git commit