For developers, working in a team likes you eat and sleep daily. The question is how do they control different versions of project. In this tutorial, I want to summarize some basic commands of git bash for project version control in a remote programming.
How undo modifications on a certain file
git branch new_branch_name
git checkout branch_name
git checkout — file-name
git status -s
git add file1.txt file2.html
git add -A
git commit -m “add/modify the file xxx”
git pull –rebase
Pushing is how you transfer commits from your local repository to a remote one. It’s the counterpart to git fetch, but whereas fetching imports commits to local branches, pushing exports commits to remote branches.
Changing a commit message
If a commit message makes non-sense and might contain unclear, incorrect or sensitive information, you can amend it locally and then push a new commit with a new message to your git repository.
Rewriting the most recent commit message
The most recent commit message can be amended by using the following command:git commit --amend