-
Notifications
You must be signed in to change notification settings - Fork 435
Git command lines
Yulei Sui edited this page Oct 18, 2022
·
9 revisions
git clone https://github.com/SVF-tools/SVF.git
git config --global user.name "Your name"
git config --global user.email "youremail@gmail.com"
git status
git log
git pull
git add your_file
git commit -m "comments"
git push
git reset HEAD yourfile
git remote add upstream https://github.com/SVF-tools/SVF.git
git pull upstream master
git push origin master # push to your repo once after your pull from a remote repo
git remote add upstream https://github.com/SVF-tools/SVF.git
git push upstream master
git clone https://github.com/SVF-tools/SVF.git
cd public-repo
git remote add private_repo_yourname https://github.com/yuleisui/SVF.git
git checkout -b pull_request_yourname
git pull private_repo_yourname master
git push origin pull_request_yourname
git checkout [name_of_your_existing_branch]
git checkout origin/master
git checkout -b [name_of_your_new_branch]
Push the branch on github :
git push origin [name_of_your_new_branch]
11. Delete a Local Git branch (first, you need to switch to another branch to delete the one you want)
git branch -d branch_name
git push origin --delete <branch_name>
git rebase -i commitId
For example, there are two commits 154a03f6
and ac9c1fd4
after a commit e06b526
(git rebase -i e06b526).
You will need to change the following two pick
to be s
, so that the two commits are merged to e06b526
pick e06b526 dyn lib 18.04 ubuntu
pick 154a03f6 update bc files
pick ac9c1fd4 Update build.sh
pick e06b526 dyn lib 18.04 ubuntu
s 154a03f6 update bc files
s ac9c1fd4 Update build.sh
Finally, you will need to force git push
git push -f