-
Notifications
You must be signed in to change notification settings - Fork 0
WORKING WITH GIT
git status
git add
git commit -m "<Message_desc>"
By the above command, the changes that are added for commit will be applied to the checkout repo with commit message <Message_desc>
git commit -a -m "<Message_desc>"
If we need to commit all the changes performed in the checkout branch we can merge the add and commit operation into one by using the option -a (add).
git branch <New_Branch_Name>
This will create a new branch from the current check out branch by name .
git branch <New_Branch_Name> <Branch_1>
This will create a new branch from the Branch_1 by name <New_Branch_Name>.
git checkout -b <New_Branch_Name>
This will create a new branch from the current check out branch by name <New_Branch_Name> and will make the new branch as the working branch.
git checkout -b <New_Branch_Name> <Branch_1>
This will create a new branch from the Branch_1 by name <New_Branch_Name> and will make the new branch as the working branch.
git branch -m <New_Name>
git diff <Branch_1> <Branch_2>
e.g) git diff master remotes/origin/master
git checkout <local_Branch>
git pull
git push -u origin <new_branch_name>
git branch -d <branch_name>
The -d option stands for --delete, this would delete the local branch, only if you have already pushed and merged it with your remote branches.
git branch -D <branch_name>
The -D option stands for --delete --force, this deletes the branch regardless of its push and merge status, so pay caution.
git push <remote_name> --delete <branch_name>
or
git push <remote_name> :<branch_name>
Note: The above option can also be used to delete a tag.
Below command to view the list of Branches that will get deleted from local remote branch.
git remote prune origin --dry-run
Below command to delete the Branches from local remote branch that are deleted from the Remote Repository.
git remote prune origin
More details in the URL: Click here
- Checkout to BranchB
git checkout BranchB
- Checkout the files from BranchA that needs to be copied into BranchB
git checkout BranchA file1 file2
Edit your git config to an add an entry for gui in the alias section
[alias]
gui = !sh -c '/usr/local/git/libexec/git-core/git-gui'