forked from Mastermind-sap/Opensource
-
Notifications
You must be signed in to change notification settings - Fork 0
/
a.txt
35 lines (35 loc) · 1.73 KB
/
a.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
git init ->intialised repo
git add <filename>->added file
U->untracked
A->added
git commit
git config --global user.name "Saptarshi"
git config credential.helper store
git config --unset credential.helper
git log
git status
git diff -> shows changes in repo
git log --all --decorate --graph --oneline
git branch ->new branch
git switch ->change branch
git -am "message"->add and commit(otherwise we need to add and commit separately everytime)
git branch
git remote add origin https://github.com/Mastermind-sap/Opensource.git
git remote -v
git push origin <branch name>
git config --global http.proxy
git config --global http.proxy http://172.16.199.20:8080
git config --global --unset http.proxy
git config --global https.proxy http://172.16.199.40:8080
git branch --delete <branchname>
git clean -f -x ->To remove all untracked files, whether they are ignored or not
// git config global file found in C:\Users\username\.gitconfig
git reset --hard ->reset all changes that were not committed
git commit --amend --no-edit -> to edit a small change like typo in the last commit without changing the commit msg or commit
git checkout --<filename> ->restore deleted file in local storage from git(i.e. when you run rm file)
git rm <filename> ->untrack a file(i.e. remove it from git)
git reset HEAD <filename> ->reset file to the version in HEAD but in git to get the file again in the working directory use git checkout
get reset HEAD~<number of commits to undo>
difference between revert and reset is that reset is used when it is not pushed to remote repo on github and revert is used when it has been pushed
git revert --no-edit HEAD
git checkout --orphan <NEWBRANCH name> -> https://gist.github.com/ozh/4734410 - create a branch from clean slate without using any source